Re: [Python-Dev] Fwd: [Python-checkins] r51236 - in python/trunk: Doc/api/abstract.tex Include/abstract.h Include/object.h Lib/test/test_index.py Misc/NEWS Modules/arraymodule.c Modules/mmapmodule.c M

2006-08-12 Thread Nick Coghlan
Travis E. Oliphant wrote: > Internally PyNumber_AsSize_t makes a call to PyNumber_Index, and > PyNumber_Index also calls the PyIndex_Check as well . So, basically we > end up calling PyIndex_Check(obj) 2 times when only one check should be > necessary. > > This code could be re-written to move

Re: [Python-Dev] What is the status of file.readinto?

2006-08-12 Thread Alexander Belopolsky
On 8/12/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Alexander Belopolsky schrieb: > > Would a patch adding "readinto" to StringIO be acceptable? > > You mean, whether it would be accepted? Depends on the patch. Here is the patch: https://sourceforge.net/tracker/index.php?func=detail&aid=153

Re: [Python-Dev] 2.6 idea: a 'function' builtin to parallel classmethod and staticmethod

2006-08-12 Thread Guido van Rossum
It ought to be called @instancemethod for a better analogy. PS Nick how's the book coming along? :-) --Guido On 8/11/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > It's sometimes useful to be able to use an existing callable as a method of a > new class. If the callable is a real function, this i

Re: [Python-Dev] What is the status of file.readinto?

2006-08-12 Thread Guido van Rossum
On 8/12/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > I can only guess why it may go away; my guess it will go away when > the buffer interface is removed from Python (then it becomes > unimplementable). In Py3k, the I/O APIs will be redesigned, especially the binary ones. My current idea is

Re: [Python-Dev] Fwd: [Python-checkins] r51236 - in python/trunk: Doc/api/abstract.tex Include/abstract.h Include/object.h Lib/test/test_index.py Misc/NEWS Modules/arraymodule.c Modules/mmapmodule.c M

2006-08-12 Thread Travis E. Oliphant
Tim Peters wrote: > [Travis E. Oliphant] >> Right now throughout the Python code it is assumed that >> sizeof(Py_ssize_t) <= sizeof(long). > > If you find any code like that, it's a bug. Win64 is a platform where > it's false. Sorry for my confusion. I meant to say that it is assumed that size

Re: [Python-Dev] Fwd: [Python-checkins] r51236 - in python/trunk: Doc/api/abstract.tex Include/abstract.h Include/object.h Lib/test/test_index.py Misc/NEWS Modules/arraymodule.c Modules/mmapmodule.c M

2006-08-12 Thread Tim Peters
[Travis E. Oliphant] > Right now throughout the Python code it is assumed that > sizeof(Py_ssize_t) <= sizeof(long). If you find any code like that, it's a bug. Win64 is a platform where it's false. ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] What is the status of file.readinto?

2006-08-12 Thread Martin v. Löwis
Alexander Belopolsky schrieb: > I know that it is a subject of an annual discussion, but since I could > not find any mention of it in the last year, let me ask this question > again: why is file.readinto "Undocumented"? It is quite useful, > particularly with numpy. > > Would a patch adding "read

Re: [Python-Dev] Fwd: [Python-checkins] r51236 - in python/trunk: Doc/api/abstract.tex Include/abstract.h Include/object.h Lib/test/test_index.py Misc/NEWS Modules/arraymodule.c Modules/mmapmodule.c M

2006-08-12 Thread Travis E. Oliphant
Neal Norwitz wrote: > I checked in this fix for the __index__ clipping issue that's been > discussed. This patch is an improvement, but still needs some work. > Please pull out any parts you have an issue with and suggest a patch > to address your concern. > For me the only remaining concern is

Re: [Python-Dev] Fwd: [Python-checkins] r51236 - in python/trunk: Doc/api/abstract.tex Include/abstract.h Include/object.h Lib/test/test_index.py Misc/NEWS Modules/arraymodule.c Modules/mmapmodule.c M

2006-08-12 Thread Travis E. Oliphant
Neal Norwitz wrote: > I checked in this fix for the __index__ clipping issue that's been > discussed. This patch is an improvement, but still needs some work. > > +/* Return a Python Int or Long from the object item > + Raise TypeError if the result is not an int-or-long > + or if the object

Re: [Python-Dev] dict containment annoyance

2006-08-12 Thread Georg Brandl
tomer filiba wrote: > [Aahz] >> -1 >> >> This is seriously no different from an attempt to do >> >> >>> a = {} >> >>> a[ [] ] = 1 > > how so? i'm not trying to modify/store anything in a dict. > i'm only testing if a certain object is contained in the dict. > that's totally different. > imagine th

[Python-Dev] Fwd: [Python-checkins] r51236 - in python/trunk: Doc/api/abstract.tex Include/abstract.h Include/object.h Lib/test/test_index.py Misc/NEWS Modules/arraymodule.c Modules/mmapmodule.c Modul

2006-08-12 Thread Neal Norwitz
I checked in this fix for the __index__ clipping issue that's been discussed. This patch is an improvement, but still needs some work. Please pull out any parts you have an issue with and suggest a patch to address your concern. n -- Forwarded message -- From: neal.norwitz <[EMAI

Re: [Python-Dev] dict containment annoyance

2006-08-12 Thread Jean-Paul Calderone
On Sat, 12 Aug 2006 18:57:02 +0200, tomer filiba <[EMAIL PROTECTED]> wrote: > >the logic is simple: every `x` is either contained in `y` or not. >if `x` *cannot* be contained in `y`, then the answer is a "strong no", >but that's still a "no". > def blacklisted(o): try: # Is the object

[Python-Dev] dict containment annoyance

2006-08-12 Thread tomer filiba
[Aahz] > -1 > > This is seriously no different from an attempt to do > > >>> a = {} > >>> a[ [] ] = 1 how so? i'm not trying to modify/store anything in a dict. i'm only testing if a certain object is contained in the dict. that's totally different. imagine this: >>> x = 6 >>> x < 2 am i trying to

Re: [Python-Dev] dict containment annoyance

2006-08-12 Thread David Hopwood
tomer filiba wrote: a={1:2, 3:4} [] in a > > Traceback (most recent call last): > File "", line 1, in ? > TypeError: list objects are unhashable > > imo, the expression should just evaluate to False instead of raising an > exception. it's a question of semantics -- i asked whether the

Re: [Python-Dev] dict containment annoyance

2006-08-12 Thread Aahz
On Sat, Aug 12, 2006, tomer filiba wrote: > > >>>a={1:2, 3:4} > >>>[] in a > Traceback (most recent call last): > File "", line 1, in ? > TypeError: list objects are unhashable > >>> > > imo, the expression should just evaluate to False instead of raising an > exception. -1 This is seriously no

[Python-Dev] [Python-3000] Python 2.5 release schedule (was: threading, part 2)

2006-08-12 Thread Aahz
[added python-dev to make sure everyone sees this] On Sat, Aug 12, 2006, Josiah Carlson wrote: > > All other feature additions are too late in the Beta cycle (Beta 3 is > next week) For some reason, this is the second time I've seen this claim. Beta 3 was released August 3 and next week is rc1.

[Python-Dev] dict containment annoyance

2006-08-12 Thread tomer filiba
>>> a={1:2, 3:4}>>> [] in aTraceback (most recent call last):  File "", line 1, in ?TypeError: list objects are unhashable>>>imo, the _expression_ should just evaluate to False instead of raising an  exception. it's a question of semantics -- i asked whether the object (a list, in this case)is cont

Re: [Python-Dev] Recent logging spew

2006-08-12 Thread Georg Brandl
Tim Peters wrote: > We're getting an awful lot of these turds at the ends of test runs now: > > Error in atexit._run_exitfuncs: > Not sure what caused it, but suspect this: > > """ > Author: georg.brandl > Date: Fri Aug 11 09:26:10 2006 > New Revision: 51206 > > Modified: > python/trunk/Lib/

[Python-Dev] Recent logging spew

2006-08-12 Thread Tim Peters
We're getting an awful lot of these turds at the ends of test runs now: Error in atexit._run_exitfuncs: Traceback (most recent call last): File "C:\Code\bb_slave\trunk.peters-windows\build\lib\atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "C:\Code\bb_slave\trunk.peters-