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

2012-04-08 Thread Paul Colomiets
Hi Antoine, On Mon, Apr 9, 2012 at 12:06 AM, Antoine Pitrou 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 >> >>     de

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-08 Thread Guido van Rossum
On Sun, Apr 8, 2012 at 5:00 PM, Victor Stinner wrote: >> IOW "What's good enough for sleep() is good enough for >> user-implemented timeouts and scheduling." as a way to reach at least >> one decision for a platform with agreed-upon cross-platform >> characteristics that are useful. > > sleep() is

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-08 Thread Cameron Simpson
On 09Apr2012 02:00, Victor Stinner wrote: | > I personally have a need for one potentially different clock -- to | > measure short intervals for benchmarks and profiling. This might be | > called time.performancetimer()? | | I deferred this topic because it is unclear to me if such timer has to |

Re: [Python-Dev] an alternative to embedding policy in PEP 418

2012-04-08 Thread Lennart Regebro
On Fri, Apr 6, 2012 at 23:26, Ethan Furman wrote: > Huh?  Your point is that all APIs are less than ideal because you have to > read the docs to know for certain how they work? No. //Lennart ___ Python-Dev mailing list Python-Dev@python.org http://mail

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-08 Thread Victor Stinner
> IOW "What's good enough for sleep() is good enough for > user-implemented timeouts and scheduling." as a way to reach at least > one decision for a platform with agreed-upon cross-platform > characteristics that are useful. sleep() is implemented in the kernel. The kernel is notified when a cloc

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

2012-04-08 Thread Benjamin Peterson
2012/4/8 Paul Colomiets : > Function 'sys.setcleanuphook' > - > > A new function for the ``sys`` module is proposed.  This function sets > a callback which is executed every time ``f_in_cleanup`` becomes > false.  Callbacks get a frame object as their sole argument, so t

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

2012-04-08 Thread Antoine Pitrou
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 > > def sigint_handler(sig, frame): > if inspect.getcleanupframe(frame) is Non

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

2012-04-08 Thread Paul Colomiets
Hi, I present my first PEP. http://www.python.org/dev/peps/pep-0419/ Added text to the end of email for easier reference. Comments are welcome. -- Paul PEP: 419 Title: Protecting cleanup statements from interruptions Version: $Revision$ Last-Modified: $Date$ Author: Paul Colomiets Status:

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-08 Thread Antoine Pitrou
On Sun, 8 Apr 2012 07:29:30 -0700 Guido van Rossum wrote: > > What to name it can't be decided this way, although I might put > forward time.sleeptimer(). interval_timer() ? I would suggest timer() simply, but it's too close to time(). > I personally have a need for one potentially different cl

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-08 Thread Guido van Rossum
On Sun, Apr 8, 2012 at 3:42 AM, Antoine Pitrou wrote: > >> | I made the same suggestion earlier but I don't know that anyone did >> | anything with it. :-( It would be nice to know what clock sleep() uses >> | on each of the major platforms. >> >> I saw it but didn't know what I could do with it,

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-08 Thread Antoine Pitrou
> | I made the same suggestion earlier but I don't know that anyone did > | anything with it. :-( It would be nice to know what clock sleep() uses > | on each of the major platforms. > > I saw it but didn't know what I could do with it, or even if it can be > found out in any very general sense.