Re: [Python-3000] MemoryError oddities

2008-07-31 Thread Antoine Pitrou
Guido van Rossum python.org> writes: > > FWIW, are there any legitimate occurrences of OverflowError in Py3k > now that ints have unlimited range? Legitimate: >>> n = 2 ** 16384 >>> float(n) Traceback (most recent call last): File "", line 1, in OverflowError: Python int too large to convert

Re: [Python-3000] __hash__ : Problem with either documentation or understanding

2008-07-31 Thread Nick Coghlan
Greg Ewing wrote: Nick Coghlan wrote: Objects which compare equal must also end up in the same hash bucket in order for dictionaries to work correctly. And, if its equality with another object can change during its lifetime, it will never work properly in a dictionary. So in that case you sho

Re: [Python-3000] MemoryError oddities

2008-07-31 Thread Nick Coghlan
Antoine Pitrou wrote: Perhaps a bit less legitimate but still :) r = range(n) len(r) Traceback (most recent call last): File "", line 1, in OverflowError: Python int too large to convert to C ssize_t Speaking of which, http://bugs.python.org/issue2690 (« Precompute range length », which ha

Re: [Python-3000] MemoryError oddities

2008-07-31 Thread Neal Norwitz
On Wed, Jul 30, 2008 at 9:36 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On Tue, Jul 29, 2008 at 10:07 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >>> +1 OverflowErrors should probably by reserved for numeric overflows. >> >> In a sense, passing sys.maxsize as a string size *is* a numeri

Re: [Python-3000] MemoryError oddities

2008-07-31 Thread Guido van Rossum
On Thu, Jul 31, 2008 at 10:32 AM, Neal Norwitz <[EMAIL PROTECTED]> wrote: > On Wed, Jul 30, 2008 at 9:36 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> On Tue, Jul 29, 2008 at 10:07 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> >> wrote: +1 OverflowErrors should probably by reserved for numer

Re: [Python-3000] __hash__ : Problem with either documentation or understanding

2008-07-31 Thread Jim Jewett
On 7/29/08, Chris Rebert <[EMAIL PROTECTED]> wrote: > If the latter, than you shouldn't implement __hash__ because, as the > docs you quote say, Bad Things (tm) will happen if someone puts your > object into a dict and then mutates it. Not quite. > So really it comes down to answering the que

[Python-3000] is it easier to multithread ?

2008-07-31 Thread binaryjesus
Is these any improvement in multi-threaded performance in the py3k scheduler over py2? >From what i know py2 runs only 1 (one) pythn thread at a time (refer 1 below). Another thing that i would like to see being included in python is auto-mutex like the java implementation. That would make my life

Re: [Python-3000] MemoryError oddities

2008-07-31 Thread Amaury Forgeot d'Arc
2008/7/21 Georg Brandl <[EMAIL PROTECTED]>: b"a"*sys.maxsize > Traceback (most recent call last): > File "", line 1, in > MemoryError > [41297 refs] b"a"*sys.maxsize > Traceback (most recent call last): > File "", line 1, in > File "", line 1, in > MemoryError > [41317 refs] b"

Re: [Python-3000] MemoryError oddities

2008-07-31 Thread Antoine Pitrou
Amaury Forgeot d'Arc gmail.com> writes: > > I corrected this with r65341. > But this prebuilt MemoryError has another nasty consequence: > when PyErr_NoMemory is raised, the traceback is attached to the > prebuilt object, > and all local variables of the failing procedure are still referenced > a

Re: [Python-3000] is it easier to multithread ?

2008-07-31 Thread Benjamin Peterson
On Thu, Jul 31, 2008 at 10:18 AM, binaryjesus <[EMAIL PROTECTED]> wrote: > Is these any improvement in multi-threaded performance in the py3k > scheduler over py2? No. However, 2.6 and 3.0 have gained the multiprocessing module to do concurrency over multiply processes. > >From what i know py2 ru

Re: [Python-3000] is it easier to multithread ?

2008-07-31 Thread Josiah Carlson
On Thu, Jul 31, 2008 at 8:18 AM, binaryjesus <[EMAIL PROTECTED]> wrote: > Is these any improvement in multi-threaded performance in the py3k > scheduler over py2? > >From what i know py2 runs only 1 (one) pythn thread at a time (refer 1 > below). Another thing that i would like to see being includ