Re: [Python-Dev] A proposal: configuring logging using dictionaries

2009-10-18 Thread Vinay Sajip
Nick Coghlan ncoghlan at gmail.com writes: My other question is whether or not it would be worth having the logging module able to export it's *current* configuration in dictionary form. I don't have a use case other than that it might be useful for debugging logging configuration errors when

[Python-Dev] nonstandard behavior of reflected functions

2009-10-18 Thread Darren Dale
According to http://docs.python.org/reference/datamodel.html , the reflected operands functions like __radd__ are only called if the left operand does not support the corresponding operation and the operands are of different types. [3] For instance, to evaluate the expression x - y, where y is an

Re: [Python-Dev] nonstandard behavior of reflected functions

2009-10-18 Thread Darren Dale
On Sun, Oct 18, 2009 at 10:50 AM, Darren Dale dsdal...@gmail.com wrote: According to http://docs.python.org/reference/datamodel.html , the reflected operands functions like __radd__ are only called if the left operand does not support the corresponding operation and the operands are of

[Python-Dev] SIGCHECK() in longobject.c

2009-10-18 Thread Antoine Pitrou
Hello, In Objects/longobject.c, there's the SIGCHECK() macro which periodically checks for signals when doing long integer computations (divisions, multiplications). It does so by messing with the _Py_Ticker variable. It was added in 1991 under the title Many small changes, and I suppose it was

Re: [Python-Dev] SIGCHECK() in longobject.c

2009-10-18 Thread Mark Dickinson
On Sun, Oct 18, 2009 at 9:01 PM, Antoine Pitrou solip...@pitrou.net wrote: In Objects/longobject.c, there's the SIGCHECK() macro which periodically checks for signals when doing long integer computations (divisions, multiplications). It does so by messing with the _Py_Ticker variable. It

Re: [Python-Dev] SIGCHECK() in longobject.c

2009-10-18 Thread Antoine Pitrou
Mark Dickinson dickinsm at gmail.com writes: Yes, I suspect there are. Though you don't need millions of digits for a single operation to take a noticeable amount of time: try str(10**10), for example. Is there a benefit to removing the check? Apart from casual cleanup, the reason

Re: [Python-Dev] nonstandard behavior of reflected functions

2009-10-18 Thread Ehsan Amiri
I see the same behaviour, moreover when I change class Quantity to a classic class (removing '(object)'), it works as expected. (i.e. Quanitity.__add__() is called after the fourth print. I run Python 2.6.2 on Vista. On Sun, Oct 18, 2009 at 7:50 AM, Darren Dale dsdal...@gmail.com wrote:

Re: [Python-Dev] SIGCHECK() in longobject.c

2009-10-18 Thread Daniel Stutzbach
On Sun, Oct 18, 2009 at 3:01 PM, Antoine Pitrou solip...@pitrou.net wrote: Can we remove this check, or are there people doing million-digits calculations they want to interrupt using Control-C ? I sometimes do million-digits calculations that I want to interrupt using Control-C.

Re: [Python-Dev] SIGCHECK() in longobject.c

2009-10-18 Thread Antoine Pitrou
Daniel Stutzbach daniel at stutzbachenterprises.com writes: I sometimes do million-digits calculations that I want to interrupt using Control-C.(particularly when I didn't *intend* to do a million-digits calculation... ;) )-- Sure, but it's no different than doing, e.g.:

Re: [Python-Dev] SIGCHECK() in longobject.c

2009-10-18 Thread Daniel Stutzbach
On Sun, Oct 18, 2009 at 5:46 PM, Antoine Pitrou solip...@pitrou.net wrote: Daniel Stutzbach daniel at stutzbachenterprises.com writes: I sometimes do million-digits calculations that I want to interrupt using Control-C.(particularly when I didn't *intend* to do a million-digits

Re: [Python-Dev] nonstandard behavior of reflected functions

2009-10-18 Thread Nick Coghlan
Ehsan Amiri wrote: I see the same behaviour, moreover when I change class Quantity to a classic class (removing '(object)'), it works as expected. (i.e. Quanitity.__add__() is called after the fourth print. I run Python 2.6.2 on Vista. Darren found the explanation further down the page he was

[Python-Dev] Python 2.6.4rc2

2009-10-18 Thread Barry Warsaw
Hello everyone. The source tarballs and Windows installers for Python 2.6.4rc2 are now available: http://www.python.org/download/releases/2.6.4/ Please download them, install them, and try to use them with your projects and environments. Let's make 2.6.4 a rock solid release! If there