On behalf of the Python development team and the Python community, I'm
happy to announce the first alpha release of Python 3.1.
Are there any plans for a Windows installer?
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
>>> You might also want to collect a list of serious changes that you
>>> want in this release;
Bob Ippolito has a good sized patch to update the json module
and improve its performance.
http://bugs.python.org/issue4136
Raymond
You might also want to collect a list of serious changes that you
want in this release;
I'm making minor updates to the decimal module to match the 1.68 version of the
spec.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
I'm making minor updates to the decimal module to match the 1.68 version of the
spec.
Looks like most was already done. Just needs some doc fixes.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/lis
and memory allocations.
Without addressing those, I think decimal will remain critically
performance challenged compared to native floats (decimals
will never be that fast, but they can get close enough to make
them a viable alternative for many kinds of work).
to
annoint one like __lt__ as the one true underlying method.
When it's ready, I'll bring it to python-dev for discussion.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubs
s of it as follows:
[Raymond Hettinger]
FWIW, I'm working on a solution for the problem using class decorators.
The idea is that it would scan a class and fill-in missing methods based
on the ones already there. That way, any one of the four ordering
relations can be provided as a starting poi
at to call it (total_ordering is one possibilty)
and where to put it (functools is a possibility).
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/optio
to be frustrating and non-obvious. Putting in a thousands separator is a
common task for output destined to be read by non-programmers.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
possible use case.
My pocket calculators all support thousands separators but in Python,
we have to do a funky dance for even this most basic bit of formatting.
I'd like to think that in 2009 we could show a little progress beyond
C's printf() or Fortran's write() formats.
f
decimal points, mayan number systems and whatnot). Will
start with Nick's simple proposal as a starting point.
[Nick Coghlan]
[[fill]align][sign][#][0][minimumwidth][,][.precision][type]
Other suggestions and comments welcome.
Raymond
___
Pyt
other day.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
ed suggestions by Lie Ryan and Eric Smith
---
PEP: XXX
Title: Format Specifier for Thousands Separator
Version: $Revision$
Last-Modified: $Date$
Author: Raymond Hettinger
Status: Draft
Type: Standards Track
Content-Type: text/x-rst
Created: 12-
Fixed typo in the example with spaces and commas.
Discussion draft at: http://www.python.org/dev/peps/pep-0378/
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mail
cases for operator.isub() for example.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
never should have been (IMO). It wastes the time of
people who try to use them and then find-out that they don't
act as expected (the assignment doesn't take place) or that
you can't use them with containers s[k] += x etc.)
Maybe someone somewhere has some interesting use for
idea. Look's like the answer is yes, everyone is
happy with the functions and are glad they were added in 2.5.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscr
they are.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
would much rather this sort of work than having a student build a new library
module and then not be around to maintain it.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscr
[Benjamin Peterson]
It seems Andrew will be doing "What's new in Python 2.7?" again, but
we don't seem to have a volunteer to do the 3.1 version? Would anyone
like to volunteer?
I'll pick-up this responsibility.
Raymond
__
e the appearance of
the output, the module is unusable. This is likely a two to
three day project, easy and fun.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.pytho
s, it will be harder to know
whether the issue is with the extension or with us.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-d
that were put
there for a reason doesn't seem useful at all.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%4
Does anyone remember the reason that most of the named methods were omitted from the ABC for mutablesets and sets? The update()
method in particular would be nice to have.
RAymond
___
Python-Dev mailing list
Python-Dev@python.org
http
oops whose cost is heavily due to array access
are common.
I thought people used PyList_GET_ITEM or something similar
in those use situations.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/
code may lead to a severe performance
penalty. This is especially true for set and get operations.
See my comments in http://bugs.python.org/issue5654
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/pyt
would need a PEP at
the very least).The case for how it helps us is somewhat thin. The case
for DTrace hooks was much stronger.
If something does go in, it should be #ifdef'd out by default. But then, I
don't think it should go in at all.
Raymond
On Thu, Apr 2, 2009 at 0
hts on the subject bug you, I'll happily
withdraw from the thread. I don't aspire to be a
source of negativity. I just happen to think this
proposal isn't a good idea.
Raymond
- Original Message -
From: "Guido van Rossum"
To: "Raymond Hettinger
whole language.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Yes.
BTW, the same rule also applies to __len__. IIRC, Tim proposed
to add that to the docs somewhere.
Perhaps Raymond can shed some light on these.
Can't guess the future of __length_hint__().
Since it doesn't have a slot, the attribute lookup
can actually slow down cases wi
Hrvoje Niksic wrote:
I've stumbled upon an oddity using sets. It's trivial to test if a
value is in the set, but it appears to be impossible to retrieve a
stored value,
See: http://code.activestate.com/recipes/499299/
Raymond
___
each inside any function or container to retrieve the "other"
value that is equivalent to "self".
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
ts written-out
to a PyFloat object and is squeezed back into a C double (potentially
introducing double-rounding if extended precision had be used by
the FPU). Disabling the peepholer doesn't change this situation.
Raymond
___
Python-Dev mailing list
P
[Tennessee Leeuwenburg ]
Now, I know that sets aren't ordered, but...
foo = set([1,2,3,4,5])
bar = [1,2,3,4,5]
foo.pop() will reliably return 1
while bar.pop() will return 5
discuss :)
If that's what you need:
http://code.activestate.com/recipes/576694/
g, once again, that bytes support is already broken in the current py3k
trunk).
+1
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
s responsive to detailed patch review. He gave a popular talk
at PyCon less than two weeks ago. He's not derelict.
I can understand that you don't want to spend much time on it. How
about removing it from 3.1? We could re-add it when long-term support
becomes
ver the types are the
same?
def object.__lt__(self, other):
if type(self) == type(other):
return id(self) < id(other)
raise TypeError
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pyt
ult comparisons.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
of it.
Cheers,
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
e
e-notation. The xmlrpc spec only accepts decimal expansions
not %e notation.
* The programmer needs to have some way to spell-out a
decimal expansion when needed. Currently, %f is the only way.
Raymond
___
Python-Dev mailing list
Pytho
on was too rushed (see David Moss's
comment on the tracker and later comments by Antoine Pitrou).
Does anyone here know if Clay's concern about subnets vs netmasks in accurate
and whether it affects the usability of the module?
Raymond
___
Pyt
EWS. Yesterday, there was a conversation on IRC
(including the RM) where it was discussed. So, in the unlikely event
that Guido changes his mind, there is still time to do so.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pyt
[GvR]
Whoa. Are you all suddenly trying to turn Python into a democracy?
Arthur: I am your king!
Woman: Well I didn't vote for you!
Arthur: You don't vote for kings.
Woman: Well how'd you become king then?
[Angelic music plays...]
Arthur: The Lady of the Lake, her arm clad in the purest s
l.)
[Benjamin Peterson]
As Raymond and Gregory have pointed out in this thread, the library is
quite independent as it stands now in the stlib, so should be trivial
to remove. Nothing else should be affected.
Guido, have you made a firm decision to remove ipaddr.py from 3.1?
The guys on IRC are
3k
branch. Probably, it is best to continue with that practice lest we muck-up
his merge/block entries.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.o
1), ('yellow', 8), ('black', 0)]
data.sort(key=lambda r: r[1])# key function called exactly len(data) times
keys = [r[1] for r in data]
data[bisect_left(keys, 0)]
('black', 0)
data[bisect_left(keys, 1)]
('blue', 1)
data[bisect_left(keys
Forge ;-)
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
known to be problematic.
Leaving it in will enshrine it. Better to just provide our new
syntax that correctly handles the common case and then
wait to carefully think through how to add support for passed-in
nested cm's if in-fact those turn-out to have reasonable
use cases.
ng the idea to change the DeprecationWarning
to a PendingDeprecationWarning, but I don't think we're doing
the users any favors by hiding the warning message.
Raymond
P.S. If you switch to PendingDeprecationWarning, the example
in the docs should probably be switched to show the one valid
use
oint in a general purpose process PEP.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
On behalf of the Python development team, I'm thrilled to announce the first
production release of Python 3.1.
Sweet!
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
eError else 0 # default to zero for empty
sequences
It would also be helpful in calculations that have algebraic restrictions:
sample_std_deviation = sqrt(sum(x - mu for x in seq) / (len(seq)-1)) except
ZeroDivisionError else float('Inf')
Raymond
__
ut a
recipe there for a long period generator,
http://code.activestate.com/recipes/576707/ ,
but there doesn't seem to have been any real interest in generators with
longer periods than MT.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
ether.
IMO, its only virtue is that people coming from functional languages
are used to having compose. Otherwise, it's a YAGNI.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscr
'd be skeptical that this
would make any macrobenchmarks (statistically) significantly faster.
I concur with Collin. And since it appears only at the end of a function,
the optimization doesn't help inner-loops in a function (where most of
the time usually sp
I fail to understand this crude logic.
If a function contains any looping (C or otherwise) or does much in
the way of meaningful work, then it's unlikely that the single POP_TOP
associated with an implied "return None" is taking much of the total
runt
On Sep 1, 2009, at 2:54 PM, Benjamin Peterson wrote:
2009/9/1 Brett Cannon :
On Tue, Sep 1, 2009 at 07:21, Benjamin
Peterson wrote:
2009/8/31 xiaobing jiang :
My idea is: here, the two functions (or maybe classes) should
have the
same behavior).
so is this a bug or something I missing ?
I concur. Numbers are naturally right aligned.
On Sep 7, 2009, at 2:46 PM, Eric Smith wrote:
The default string formatting alignment for all types, according to
PEP 3101, is left aligned. Issue 6857 (http://bugs.python.org/issue6857
) points out that for numeric types (int, float, and decim
And I sort of disagree with saying it's naturally left- or right-
aligned; as numbers are naturally (decimal) dot-aligned (if you use dot
to separate the whole and fractional part of your number).
How about, "naturally aligned by place value&q
t have to look up what tracker name
someone uses since I know everyone's committer name.
+1 from me also. This has long been a source of irritation.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/lis
[Michael Foord]
Are we definitely decided that 2.7 will be the last major release in the
2.x cycle?
ISTM, that would depend on the uptake for 3.2.
The users get a say in the matter.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http
nd the desire to have all formatting support both ways,
but I don't think it is worth the costs. People *never* need both ways
though they may have differing preferences about which *one* to use.
my-two-cents,
Raymond
___
Python-Dev mailing
frequently have to lookup
the syntax and need to experiment with the interactive interpreter to get it
right.
I haven't found it easy to teach or to get other people to convert. This is
especially true if the person has encountered %-formatting in other languages
(it is a popular appro
[Sridhar Ratnakumar]
2.6.3rc1 builds fine on Linux x86/x86_64, MacOSX 10.4 ppc/x86, Windows
32bit/64bit, HP-UX, AIX and Solaris just like 2.6.2 did.
Did the test suite pass too?
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http
any of the competing packages ever
found a need to add support for this yet-to-be-presented use case:
http://code.google.com/p/netaddr/wiki/YetAnotherPythonIPModule
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mai
[Vinay Sajip]
And the special wrappers needn't be too intrusive:
__ = BraceMessage
logger.debug(__("Message with {0} {1}", 1, "argument"))
It looks like the BraceMessage would have to re-instantiate on every invocation.
Raymond
_
it as the preferred syntax.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Terry Reedy]
I would agree, for instance, that an auto-translation
tool is needed.
We should get one written. ISTM, every %-formatting
string is directly translatable to an equivalent {}-formatting string.
Raymond
___
Python-Dev mailing list
ng
is that in most cases (things like the logging API excluded) you can
change it one format string at a time.
I've already have some code that mixes the styles (using {} for new stuff).
Raymond
___
Python-Dev mailing list
Python-Dev@pytho
Python source. There's no shortage of
conversion bugs in the wild, and certainly bugs have been observed in
OS X, Linux and Windows. (The ones I found in OS X 10.5 have
been fixed in OS X 10.6, though.)
Nice win.
Thoughts?
+1
I've worked with the 3.1 fl
[Glyph Lefkowitz ]
> This reasoning definitely makes sense to me; with all the
> dependency-migration
> issues 3.x could definitely use some carrots. However, I don't think I agree
> with it,
> because this doesn't feel like a big new feature, just some behavior which
> has changed.
The c
you've retrieved an arbitrary element without
removing it, then successive calls to "choose" could
potentially retrieve the exact same element again and again.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pytho
ot;iter(s).next()" is probably clearest,
and at least will throw a StopIteration exception if the set is empty.
"for x in s: break" is just confusing ...
A short comment would do wonders.
Raymond
P.S. It is weird that this thread is gaining traction at the s
n any code using it, nor any bug reports or documentation
requests, nor any code in the ASPN cookbook, nor mention of it
on the newsgroup or python-help.
Has anyone here seen any hints about how this is faring in the wild?
Raymond
___
Python-Dev ma
nt.
I look forward to reading the code.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
in a loop (because the key can vary).
A set.get() returns the same value over and over again (because there is no
key).
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.
recipe
to your utils directory. That will get the job done (thought I don't
expect that you will *ever* make much use of either one).
No need to complexify a type that is currently very simple.
Raymond
P.S. get_equivalent: http://code.activestate.com/recipes/499299/
get
but it actual
implementation it will make sets more difficult to learn and it would quickly become a piece of rarely used, poorly understood
cruft.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/pyth
backport it.
FWIW, I support backporting the nonlocal-keyword in 2.7.
All of the reasons for introducting nonlocal to 3.x also apply to 2.x.
Using the nonlocal keyword in clear and explicit, especially
when compared to the existing workarounds which are not pretty.
Raymond
ng that makes it a better
solution for 3.x than 2.x? Just curious about the pros and cons
from your point of view.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.p
their decision to stay with 2.x, or
switch to 3.x, or try to support both. We should not muck with their rational decision making by putting "carrots" in one pile and
abandoning the other.
Raymond
P.S. I found it curious that one of the strongest proponents of killing 2.x also mentio
vious
or easily discoverable" then they should be _made_ so with documentation.
Comments?
That's reasonable. It's in the same category as people who can't figure-out how to clear a list because they forgot about slice
notation.
Raymond
no
sense)
6) absence of real-world code examples that would be meaningfully improved
I would be happy to add an example to the docs so that this thread
can finally end.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.o
so much fun to have a never ending python-ideas
thread on BEGIN/END blocks ;-)
C'est la vie,
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailma
API for something so trivial and so rarely
needed.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
rable):
'Return the first value from a container or iterable. If empty, raises
LookupError'
for value in iterable:
return value
raise LookupError('no first value; iterable is empty')
If desired, it is not hard to change to the last time to return a default value
or some o
s the full behaviors specified by
the standard, they need to use the actual compare() method which
allows for a decimal context to be specified and allows for more than
just a true/false return value (i.e. a NaN is a possible result).
Raymond
___
Pytho
, would shorter release cycles
still have a negative impact? Do people possibly want slower changes
to the language and faster updates to the library?
I don't know the answer. Just asking how this matches up with the
feedback you have gotten previously.
Ra
onths.
My preference is to decouple and let 2.7 go out 18 months after 2.6.
In general, 2.x users should not have to pay a price for whatever
we do with 3.x.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/lis
[Jacob Kaplan-Moss]
I've already started on a patch to make comments an option that
package maintainers could turn on or off, but I don't want to waste
any more time fighting this code unless I have some assurance it'll be
checked in.
I support your eff
On Jan 25, 2010, at 11:22 AM, Steve Howell wrote:
> I am interested in creating a patch to make deleting elements from the front
> of Python list work in O(1) time by advancing the ob_item pointer.
+1 on doing whatever experiments you feel like doing
-1 on putting something like this in the cor
27;abc')
s.pop(0)
print s[i] # i no longer points at 'abc'
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
from the front and back. In comparison, the proposed
changes to lists seem like a complete hack. Just because
it can be done, doesn't mean that it should.
ISTM that you're attacking an already solved problem
and that you're playing fast and loose with a core data
structure.
Ra
m better than it does now but not as well
as a deque which never has to move data).
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
data structure?
Raymond
On Jan 27, 2010, at 1:50 PM, Nick Coghlan wrote:
> Steve Howell wrote:
>> There is also the possibility that my initial patch can be refined by
>> somebody smarter than myself to eliminate the particular tradeoff.
>> In fact, Antoine Pitrou already
On Jan 27, 2010, at 2:56 PM, Steve Howell wrote:
>
> --- On Wed, 1/27/10, Raymond Hettinger wrote:
>
>> From: Raymond Hettinger
>> Subject: Re: [Python-Dev] patch to make list.pop(0) work in O(1) time
>> To: "Martin v. Löwis"
>> Cc: "Steve Ho
On Jan 27, 2010, at 3:55 PM, Maciej Fijalkowski wrote:
>>
>> FWIW, deque indexing for small deques is already O(1)
>> and somewhat fast. You only get O(n) degradation
>> (with a small contant factor) on large deques.
>>
>
> Hi.
>
> For small dequeues (smaller than a constant), you have to ha
s besides tidiness. It hides the implementation
details of when magic numbers get shifted. And it may allow faster
start-up times when the zipfile is in the disk cache.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python
+1
On Feb 2, 2010, at 10:08 AM, Barry Warsaw wrote:
> I'm thinking about doing a Python 2.6.5 release soon. I've added the
> following dates to the Python release schedule Google calendar:
>
> 2009-03-01 Python 2.6.5 rc 1
> 2009-03-15 Python 2.6.5 final
>
> This allows us to spend some time on
something nasty within the scope of
your user permissions.
Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
301 - 400 of 1495 matches
Mail list logo