Re: [Python-Dev] PEP-419: Protecting cleanup statements from interruptions

2012-04-09 Thread Paul Colomiets
Hi Antoine, On Mon, Apr 9, 2012 at 12:06 AM, Antoine Pitrou solip...@pitrou.net wrote: Hello Paul, Thanks for the PEP and the description of the various issues. An example implementation of a SIGINT handler that interrupts safely might look like::     import inspect, sys, functools    

Re: [Python-Dev] PEP-419: Protecting cleanup statements from interruptions

2012-04-09 Thread Paul Colomiets
Hi Benjamin, On Mon, Apr 9, 2012 at 12:42 AM, Benjamin Peterson benja...@python.org wrote: 2012/4/8 Paul Colomiets p...@colomiets.name: Function 'sys.setcleanuphook' - A new function for the ``sys`` module is proposed.  This function sets a callback which is

[Python-Dev] Removing surplus fields from the frame object and not adding any new ones.

2012-04-09 Thread Mark Shannon
The frame object is a key object in CPython. It holds the state of a function invocation. Frame objects are allocated, initialised and deallocated at a rapid rate. Each extra field in the frame object requires extra work for each and every function invocation. Fewer fields in the frame object

Re: [Python-Dev] Removing surplus fields from the frame object and not adding any new ones.

2012-04-09 Thread Andrew Svetlov
Do you want to create `frame` and `f_namespaces` every function call instead of single `frame` creation? On Mon, Apr 9, 2012 at 11:56 AM, Mark Shannon m...@hotpy.org wrote: The frame object is a key object in CPython. It holds the state of a function invocation. Frame objects are allocated,

Re: [Python-Dev] Removing surplus fields from the frame object and not adding any new ones.

2012-04-09 Thread Mark Shannon
Andrew Svetlov wrote: Do you want to create `frame` and `f_namespaces` every function call instead of single `frame` creation? f_namespaces would be part of the frame, replacing f_builtins, f_globals and f_locals. The indirection of an external object hurts performance, so it would have to be

Re: [Python-Dev] this is why we shouldn't call it a monotonic clock (was: PEP 418 is too divisive and confusing and should be postponed)

2012-04-09 Thread Victor Stinner
2012/4/9 Guido van Rossum gu...@python.org: You may need two clocks for this:  * time.perf_counter(): high-resolution timer for benchmarking, count time elasped during a sleep  * time.process_time(): High-resolution (?) per-process timer from the CPU. (other possible names:

Re: [Python-Dev] this is why we shouldn't call it a monotonic clock (was: PEP 418 is too divisive and confusing and should be postponed)

2012-04-09 Thread Victor Stinner
|  * time.process_time(): High-resolution (?) per-process timer from the | CPU. (other possible names: time.process_cpu_time() or | time.cpu_time()) POSIX offers CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID that seem to suit this need, depending on your threading situation (and what

[Python-Dev] Change to yield-from implementation

2012-04-09 Thread Greg Ewing
Mark Shannon wrote: We have recently removed the f_yieldfrom field from the frame object. (http://bugs.python.org/issue14230) Hey, wait a minute. Did anyone consider the performance effect of that change on deeply nested yield-froms? The way it was, a yield-from chain was traversed by a very

Re: [Python-Dev] Change to yield-from implementation

2012-04-09 Thread Benjamin Peterson
2012/4/9 Greg Ewing greg.ew...@canterbury.ac.nz: Mark Shannon wrote: We have recently removed the f_yieldfrom field from the frame object. (http://bugs.python.org/issue14230) Hey, wait a minute. Did anyone consider the performance effect of that change on deeply nested yield-froms? The

Re: [Python-Dev] Removing surplus fields from the frame object and not adding any new ones.

2012-04-09 Thread Andrew Svetlov
So it's really no difference between three separate fields in frame and embedded struct with those fields. On Mon, Apr 9, 2012 at 1:51 PM, Mark Shannon m...@hotpy.org wrote: Andrew Svetlov wrote: Do you want to create `frame` and `f_namespaces` every function call instead of single `frame`

Re: [Python-Dev] Change to yield-from implementation

2012-04-09 Thread Antoine Pitrou
On Tue, 10 Apr 2012 00:24:07 +1200 Greg Ewing greg.ew...@canterbury.ac.nz wrote: Mark Shannon wrote: We have recently removed the f_yieldfrom field from the frame object. (http://bugs.python.org/issue14230) Hey, wait a minute. Did anyone consider the performance effect of that change on

Re: [Python-Dev] Removing surplus fields from the frame object and not adding any new ones.

2012-04-09 Thread Andrew Svetlov
While I agree with keeping data structures simple and clean I think conserving them forever is bad idea in general. Let's look on every particular case before making decision. On Mon, Apr 9, 2012 at 3:46 PM, Andrew Svetlov andrew.svet...@gmail.com wrote: So it's really no difference between

Re: [Python-Dev] Change to yield-from implementation

2012-04-09 Thread Guido van Rossum
On Mon, Apr 9, 2012 at 5:46 AM, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 10 Apr 2012 00:24:07 +1200 Greg Ewing greg.ew...@canterbury.ac.nz wrote: Mark Shannon wrote: We have recently removed the f_yieldfrom field from the frame object. (http://bugs.python.org/issue14230) Hey,

Re: [Python-Dev] Removing surplus fields from the frame object and not adding any new ones.

2012-04-09 Thread Guido van Rossum
On Mon, Apr 9, 2012 at 3:51 AM, Mark Shannon m...@hotpy.org wrote: f_namespaces would be part of the frame, replacing f_builtins, f_globals and f_locals. The indirection of an external object hurts performance, so it would have to be a struct within the frame. The aim is clarity; locals,

Re: [Python-Dev] Removing surplus fields from the frame object and not adding any new ones.

2012-04-09 Thread Mark Shannon
Guido van Rossum wrote: On Mon, Apr 9, 2012 at 3:51 AM, Mark Shannon m...@hotpy.org wrote: f_namespaces would be part of the frame, replacing f_builtins, f_globals and f_locals. The indirection of an external object hurts performance, so it would have to be a struct within the frame. The aim is

Re: [Python-Dev] Removing surplus fields from the frame object and not adding any new ones.

2012-04-09 Thread martin
The point I really wanted to make is that many of the fields in the frame object belong elsewhere and adding new fields to the frame object is generally a bad idea. I disagree with that statement, and don't think you have offered sufficient proof of it. The structure may look irregular to you,

Re: [Python-Dev] Removing surplus fields from the frame object and not adding any new ones.

2012-04-09 Thread Guido van Rossum
On Mon, Apr 9, 2012 at 8:17 AM, Mark Shannon m...@hotpy.org wrote: Guido van Rossum wrote: On Mon, Apr 9, 2012 at 3:51 AM, Mark Shannon m...@hotpy.org wrote: f_namespaces would be part of the frame, replacing f_builtins, f_globals and f_locals. The indirection of an external object hurts

Re: [Python-Dev] [Python-checkins] cpython: #14533: if a test has no test_main, use loadTestsFromModule.

2012-04-09 Thread Terry Reedy
On 4/9/2012 9:13 AM, r.david.murray wrote: http://hg.python.org/cpython/rev/eff551437abd changeset: 76176:eff551437abd user:R David Murrayrdmur...@bitdance.com date:Mon Apr 09 08:55:42 2012 -0400 summary: #14533: if a test has no test_main, use loadTestsFromModule. This

[Python-Dev] Failed issue tracker submission

2012-04-09 Thread Python tracker
An unexpected error occurred during the processing of your message. The tracker administrator is being notified. Return-Path: python-dev@python.org X-Original-To: rep...@bugs.python.org Delivered-To: roundup+trac...@psf.upfronthosting.co.za Received: from mail.python.org (mail.python.org

[Python-Dev] Failed issue tracker submission

2012-04-09 Thread Python tracker
An unexpected error occurred during the processing of your message. The tracker administrator is being notified. Return-Path: python-dev@python.org X-Original-To: rep...@bugs.python.org Delivered-To: roundup+trac...@psf.upfronthosting.co.za Received: from mail.python.org (mail.python.org

Re: [Python-Dev] [Python-checkins] cpython: #14533: if a test has no test_main, use loadTestsFromModule.

2012-04-09 Thread Matt Joiner
On Apr 10, 2012 2:36 AM, Terry Reedy tjre...@udel.edu wrote: On 4/9/2012 9:13 AM, r.david.murray wrote: http://hg.python.org/cpython/rev/eff551437abd changeset: 76176:eff551437abd user:R David Murrayrdmur...@bitdance.com date:Mon Apr 09 08:55:42 2012 -0400 summary:

Re: [Python-Dev] [Python-checkins] cpython: Issue #13165: stringbench is now available in the Tools/stringbench folder.

2012-04-09 Thread Terry Reedy
Some comments... On 4/9/2012 11:09 AM, antoine.pitrou wrote: http://hg.python.org/cpython/rev/704630a9c5d5 changeset: 76179:704630a9c5d5 user:Antoine Pitrousolip...@pitrou.net date:Mon Apr 09 17:03:32 2012 +0200 summary: Issue #13165: stringbench is now available in the

Re: [Python-Dev] [Python-checkins] cpython: #14533: if a test has no test_main, use loadTestsFromModule.

2012-04-09 Thread R. David Murray
On Mon, 09 Apr 2012 13:34:25 -0400, Terry Reedy tjre...@udel.edu wrote: On 4/9/2012 9:13 AM, r.david.murray wrote: http://hg.python.org/cpython/rev/eff551437abd changeset: 76176:eff551437abd user:R David Murrayrdmur...@bitdance.com date:Mon Apr 09 08:55:42 2012 -0400

[Python-Dev] Upgrading tcl/tk deps

2012-04-09 Thread Brian Curtin
Can someone let me in on the process to upgrade tcl and tk on svn.python.org? For the VS2010 port it looks like I need to upgrade since the 8.5.9 versions do not work. They use link options that choke on 2010. Taking 8.5.11, which is the current release, seems to work out alright so far. It seems

Re: [Python-Dev] [Python-checkins] cpython: Issue #13165: stringbench is now available in the Tools/stringbench folder.

2012-04-09 Thread Antoine Pitrou
On Mon, 09 Apr 2012 14:54:03 -0400 Terry Reedy tjre...@udel.edu wrote: diff --git a/Tools/stringbench/stringbench.py b/Tools/stringbench/stringbench.py new file mode 100755 --- /dev/null +++ b/Tools/stringbench/stringbench.py @@ -0,0 +1,1483 @@ + Did you mean to start with a

[Python-Dev] Who are the decimal volunteers? Re: [Python-checkins] cpython: Resize the coefficient to MPD_MINALLOC also if the requested size is below

2012-04-09 Thread Jim Jewett
I remember that one of the concerns with cdecimal was whether it could be maintained by anyone except Stefan (and a few people who were already overcommitted). If anyone (including absolute newbies) wants to step up, now would be a good time to get involved. A few starter questions, whose answer

Re: [Python-Dev] Upgrading tcl/tk deps

2012-04-09 Thread martin
Zitat von Brian Curtin br...@python.org: Can someone let me in on the process to upgrade tcl and tk on svn.python.org? For the VS2010 port it looks like I need to upgrade since the 8.5.9 versions do not work. They use link options that choke on 2010. Taking 8.5.11, which is the current

Re: [Python-Dev] [Python-checkins] Who are the decimal volunteers? Re: cpython: Resize the coefficient to MPD_MINALLOC also if the requested size is below

2012-04-09 Thread Stefan Krah
Jim Jewett jimjjew...@gmail.com wrote: Why is there any need for MPD_MINALLOC at all for (immutable) numbers? I suspect that will involve fleshing out some of the memory management issues around dynamic decimals, as touched on here:

Re: [Python-Dev] this is why we shouldn't call it a monotonic clock (was: PEP 418 is too divisive and confusing and should be postponed)

2012-04-09 Thread Cameron Simpson
On 09Apr2012 13:26, Victor Stinner victor.stin...@gmail.com wrote: | | On Windows, GetProcessTimes() has not a high-resolution: it has a | | accuracy of 1 ms in the best case. | | This page: |   http://msdn.microsoft.com/en-us/library/windows/desktop/ms683223%28v=vs.85%29.aspx | says

Re: [Python-Dev] this is why we shouldn't call it a monotonic clock (was: PEP 418 is too divisive and confusing and should be postponed)

2012-04-09 Thread Victor Stinner
sleep() is implemented in the kernel. The kernel is notified when a clock is set, and so can choose how to handle time adjustement. Most sleeping functions use the system clock but don't care of clock adjustement. We're going around in circles. I'm not asking what sleep does, I want on

Re: [Python-Dev] [Python-checkins] cpython: #14533: if a test has no test_main, use loadTestsFromModule.

2012-04-09 Thread Terry Reedy
On 4/9/2012 3:57 PM, R. David Murray wrote: On Mon, 09 Apr 2012 13:34:25 -0400, Terry Reedytjre...@udel.edu wrote: Should t.unittest.main(t.__name__) work as well? That will work. t.unittest.main(t) will also work and is less typing. Good. The only doc for the parameter is

Re: [Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-09 Thread Gregory P. Smith
On Sat, Apr 7, 2012 at 4:56 PM, Glyph Lefkowitz gl...@twistedmatrix.comwrote: On Apr 7, 2012, at 3:40 AM, Steven D'Aprano wrote: In any case, NTP is not the only thing that adjusts the clock, e.g. the operating system will adjust the time for daylight savings. Daylight savings time is not

Re: [Python-Dev] Upgrading tcl/tk deps

2012-04-09 Thread Terry Reedy
On 4/9/2012 5:49 PM, mar...@v.loewis.de wrote: Zitat von Brian Curtin br...@python.org: Can someone let me in on the process to upgrade tcl and tk on svn.python.org? For the VS2010 port it looks like I need to upgrade since the 8.5.9 versions do not work. They use link options that choke on

Re: [Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-09 Thread Guido van Rossum
Is it still? I thought they fixed that ages ago? On Mon, Apr 9, 2012 at 4:42 PM, Gregory P. Smith g...@krypto.org wrote: On Sat, Apr 7, 2012 at 4:56 PM, Glyph Lefkowitz gl...@twistedmatrix.com wrote: On Apr 7, 2012, at 3:40 AM, Steven D'Aprano wrote: In any case, NTP is not the only thing

Re: [Python-Dev] Upgrading tcl/tk deps

2012-04-09 Thread Brian Curtin
On Mon, Apr 9, 2012 at 18:41, Terry Reedy tjre...@udel.edu wrote: In particular, it should include a recent fix so that French keyboards work with tk/tkinter and hence Idle better than now. There has been more than one complaint about this. Do you know when this was fixed or have any

Re: [Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-09 Thread Gregory P. Smith
On Mon, Apr 9, 2012 at 4:46 PM, Guido van Rossum gu...@python.org wrote: Is it still? I thought they fixed that ages ago? sadly, no. http://www.cl.cam.ac.uk/~mgk25/mswish/ut-rtc.html On Mon, Apr 9, 2012 at 4:42 PM, Gregory P. Smith g...@krypto.org wrote: On Sat, Apr 7, 2012 at 4:56 PM,

Re: [Python-Dev] Upgrading tcl/tk deps

2012-04-09 Thread Terry Reedy
On 4/9/2012 7:53 PM, Brian Curtin wrote: On Mon, Apr 9, 2012 at 18:41, Terry Reedytjre...@udel.edu wrote: In particular, it should include a recent fix so that French keyboards work with tk/tkinter and hence Idle better than now. There has been more than one complaint about this. Do you know

Re: [Python-Dev] Upgrading tcl/tk deps

2012-04-09 Thread Brian Curtin
On Mon, Apr 9, 2012 at 20:53, Terry Reedy tjre...@udel.edu wrote: On 4/9/2012 7:53 PM, Brian Curtin wrote: On Mon, Apr 9, 2012 at 18:41, Terry Reedytjre...@udel.edu  wrote: In particular, it should include a recent fix so that French keyboards work with tk/tkinter and hence Idle better than

Re: [Python-Dev] Upgrading tcl/tk deps

2012-04-09 Thread Ned Deily
In article cad+xwwqqebh9abeggevjuboaspbv++yq3dtmfuadre6a3-5...@mail.gmail.com, Brian Curtin br...@python.org wrote: On Mon, Apr 9, 2012 at 20:53, Terry Reedy tjre...@udel.edu wrote: On 4/9/2012 7:53 PM, Brian Curtin wrote: On Mon, Apr 9, 2012 at 18:41, Terry Reedytjre...@udel.edu  wrote: