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

2012-04-04 Thread Steven D'Aprano
On Wed, Apr 04, 2012 at 03:28:34AM +0200, Victor Stinner wrote: > Le 04/04/2012 02:33, Steven D'Aprano a écrit : > >Judging by the hundreds of emails regarding PEP 418, the disagreements > >about APIs, namings, and even what characteristics clocks should have, I > >believe that the suggestion is to

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Paul Moore
(Sorry, should have sent to the list). On 4 April 2012 01:04, Greg Ewing wrote: > Cameron Simpson wrote: >> >> People have been saying "hires" throughout the >> threads I think, but I for one would be slightly happier with "highres". > > > hirez? What's wrong with high_resolution? Paul _

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

2012-04-04 Thread Antoine Pitrou
On Wed, 4 Apr 2012 02:02:12 +0200 Victor Stinner wrote: > > Lennart Regebro wrote: > >> Well, get_clock(monotonic=True, highres=True) would be a vast > >> improvement over get_clock(MONOTONIC|HIRES). > > I don't like this keyword API because you have to use a magically > marker (True). Why True?

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

2012-04-04 Thread Antoine Pitrou
On Wed, 4 Apr 2012 18:09:40 +1000 Steven D'Aprano wrote: > > Python 3.3 has already time.clock_gettime() and time.clock_getres() with > > CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW, CLOCK_HIGHRES. > > Why does it already have these things when the PEP is not accepted? > > (This is no

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

2012-04-04 Thread Victor Stinner
2012/4/4 Antoine Pitrou : > On Wed, 4 Apr 2012 02:02:12 +0200 > Victor Stinner wrote: >> > Lennart Regebro wrote: >> >> Well, get_clock(monotonic=True, highres=True) would be a vast >> >> improvement over get_clock(MONOTONIC|HIRES). >> >> I don't like this keyword API because you have to use a mag

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

2012-04-04 Thread Victor Stinner
>> Why does it already have these things when the PEP is not accepted? >> ... >> (This is not a rhetorical question, perhaps there is a good reason why >> these have been added independently of the PEP.) time.clock_gettime() & friends were added by the issue #10278. The function was added before s

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

2012-04-04 Thread Victor Stinner
> I failed to propose a consistent and clear API because I (and Guido!) wanted > to fallback to the system clock. Falling back to the system clock is a > problem when you have to define the function in the documentation or if you > don't want to use the system clock (but do something else) if no mo

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

2012-04-04 Thread Chris Angelico
On Wed, Apr 4, 2012 at 9:04 PM, Victor Stinner wrote: > 2012/4/4 Antoine Pitrou : >> On Wed, 4 Apr 2012 02:02:12 +0200 >> Victor Stinner wrote: >>> > Lennart Regebro wrote: >>> >> Well, get_clock(monotonic=True, highres=True) would be a vast >>> >> improvement over get_clock(MONOTONIC|HIRES). >>>

Re: [Python-Dev] .{git,bzr}ignore in cpython HG repo

2012-04-04 Thread Brett Cannon
On Mon, Apr 2, 2012 at 08:58, Thomas Spura wrote: > On Mon, Apr 2, 2012 at 2:54 PM, Stefan Behnel wrote: > > Antoine Pitrou, 02.04.2012 13:50: > >> On Sun, 1 Apr 2012 19:44:00 -0500 > >> Brian Curtin wrote: > >>> On Sun, Apr 1, 2012 at 17:31, Matěj Cepl wrote: > On 1.4.2012 23:46, Brian Curt

Re: [Python-Dev] PEP 418: rename time.monotonic() to time.steady()?

2012-04-04 Thread Lennart Regebro
On Tue, Apr 3, 2012 at 23:14, Victor Stinner wrote: >> Wait, what? >> I already thought we, several days ago, decided that "steady" was a >> *terrible* name, and that monotonic should *not* fall back to the >> system clock. > > Copy of a more recent Guido's email: > http://mail.python.org/pipermai

Re: [Python-Dev] PEP 418: rename time.monotonic() to time.steady()?

2012-04-04 Thread Antoine Pitrou
On Wed, 4 Apr 2012 17:30:26 +0200 Lennart Regebro wrote: > > Copy of a more recent Guido's email: > > http://mail.python.org/pipermail/python-dev/2012-March/118322.html > > "Anyway, the more I think about it, the more I believe these functions > > should have very loose guarantees, and instead jus

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

2012-04-04 Thread Lennart Regebro
I am fine with the PEP as it is now (2012-04-04 15:34 GMT). A question: Since the only monotonic clock that can be adjusted by NTP is Linux' CLOCK_MONOTONIC, if we avoid it, then time.monotonic() would always give a clock that isn't adjusted by NTP. That would however mean we wouldn't support mon

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

2012-04-04 Thread Lennart Regebro
On Wed, Apr 4, 2012 at 13:04, Victor Stinner wrote: > It depends if the option supports other values. But as I understood, > the keyword value must always be True. Or False, obviously. Which would also be default. //Lennart ___ Python-Dev mailing list

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Lennart Regebro
On Tue, Apr 3, 2012 at 18:07, Ethan Furman wrote: > What's unclear about returning None if no clocks match? Nothing, but having to check error values on return functions are not what you typically do in Python. Usually, Python functions that fail raise an error. Please don't force Python users to

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

2012-04-04 Thread Yury Selivanov
On 2012-04-03, at 9:28 PM, Victor Stinner wrote: > In the last version of my PEP, time.monotonic() is simply defined as "a > monotonic clock (cannot go backward)". There is no more "... best ..." in its > definition. I like the last version of the PEP ;) - Yury

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Ethan Furman
Lennart Regebro wrote: On Tue, Apr 3, 2012 at 18:07, Ethan Furman wrote: What's unclear about returning None if no clocks match? Nothing, but having to check error values on return functions are not what you typically do in Python. Usually, Python functions that fail raise an error. Please do

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Oleg Broytman
On Wed, Apr 04, 2012 at 05:47:16PM +0200, Lennart Regebro wrote: > On Tue, Apr 3, 2012 at 18:07, Ethan Furman wrote: > > What's unclear about returning None if no clocks match? > > Nothing, but having to check error values on return functions are not > what you typically do in Python. Usually, Py

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Georg Brandl
Am 04.04.2012 18:18, schrieb Ethan Furman: > Lennart Regebro wrote: >> On Tue, Apr 3, 2012 at 18:07, Ethan Furman wrote: >>> What's unclear about returning None if no clocks match? >> >> Nothing, but having to check error values on return functions are not >> what you typically do in Python. Usua

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Ethan Furman
Oleg Broytman wrote: On Wed, Apr 04, 2012 at 05:47:16PM +0200, Lennart Regebro wrote: On Tue, Apr 3, 2012 at 18:07, Ethan Furman wrote: What's unclear about returning None if no clocks match? Nothing, but having to check error values on return functions are not what you typically do in Python

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Ethan Furman
Georg Brandl wrote: Am 04.04.2012 18:18, schrieb Ethan Furman: Lennart Regebro wrote: On Tue, Apr 3, 2012 at 18:07, Ethan Furman wrote: What's unclear about returning None if no clocks match? Nothing, but having to check error values on return functions are not what you typically do in Pytho

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Oleg Broytman
On Wed, Apr 04, 2012 at 11:03:02AM -0700, Ethan Furman wrote: > Oleg Broytman wrote: > > . Pythonic equivalent of "get_clock(THIS) or get_clok(THAT)" is > > > >for flag in (THIS, THAT): > >try: > >clock = get_clock(flag) > >except: > >pass > >else: > >break > >

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Ethan Furman
Oleg Broytman wrote: On Wed, Apr 04, 2012 at 11:03:02AM -0700, Ethan Furman wrote: Oleg Broytman wrote: . Pythonic equivalent of "get_clock(THIS) or get_clok(THAT)" is for flag in (THIS, THAT): try: clock = get_clock(flag) except: pass else: break else: raise

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Cameron Simpson
On 04Apr2012 19:47, Georg Brandl wrote: | Am 04.04.2012 18:18, schrieb Ethan Furman: | > Lennart Regebro wrote: | >> On Tue, Apr 3, 2012 at 18:07, Ethan Furman wrote: | >>> What's unclear about returning None if no clocks match? | >> | >> Nothing, but having to check error values on return funct

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

2012-04-04 Thread Steven D'Aprano
Oleg Broytman wrote: On Wed, Apr 04, 2012 at 11:03:02AM -0700, Ethan Furman wrote: Oleg Broytman wrote: . Pythonic equivalent of "get_clock(THIS) or get_clok(THAT)" is for flag in (THIS, THAT): try: clock = get_clock(flag) except: pass else: break else: raise

Re: [Python-Dev] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-04 Thread Oleg Broytman
On Wed, Apr 04, 2012 at 12:52:00PM -0700, Ethan Furman wrote: > Oleg Broytman wrote: > >On Wed, Apr 04, 2012 at 11:03:02AM -0700, Ethan Furman wrote: > >>Oleg Broytman wrote: > >>> . Pythonic equivalent of "get_clock(THIS) or get_clok(THAT)" is > >>> > >>>for flag in (THIS, THAT): > >>> try: > >

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

2012-04-04 Thread Victor Stinner
2012/4/4 Lennart Regebro : > On Wed, Apr 4, 2012 at 13:04, Victor Stinner wrote: >> It depends if the option supports other values. But as I understood, >> the keyword value must always be True. > > Or False, obviously. Which would also be default. Ok for the default, but what happens if the call

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

2012-04-04 Thread Cameron Simpson
On 05Apr2012 08:50, Steven D'Aprano wrote: | Although I don't like the get_clock() API, I don't think this argument against | it is a good one. Just to divert briefly; you said in another post you didn't like the API and (also/because?) it didn't help discoverability. My core objective was to

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

2012-04-04 Thread Victor Stinner
> I failed to propose a consistent and clear API because I (and Guido!) wanted > to fallback to the system clock. Falling back to the system clock is a > problem when you have to define the function in the documentation or if you > don't want to use the system clock (but do something else) if no mo

[Python-Dev] Failed issue tracker submission

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

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

2012-04-04 Thread Greg Ewing
Lennart Regebro wrote: Since the only monotonic clock that can be adjusted by NTP is Linux' CLOCK_MONOTONIC, if we avoid it, then time.monotonic() would always give a clock that isn't adjusted by NTP. I thought we decided that NTP adjustment isn't an issue, because it's always gradual. -- Greg

Re: [Python-Dev] Failed issue tracker submission

2012-04-04 Thread R. David Murray
On Thu, 05 Apr 2012 01:29:47 -, Python tracker wrote: > > An unexpected error occurred during the processing > of your message. The tracker administrator is being > notified. Since the bounce message went here, I'm posting this here for those who are curious what caused it. It was triggere

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

2012-04-04 Thread PJ Eby
On Apr 4, 2012 7:28 PM, "Victor Stinner" wrote: > > More details why it's hard to define such function and why I dropped > it from the PEP. > > If someone wants to propose again such function ("monotonic or > fallback to system" clock), two issues should be solved: > > - name of the function > -

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

2012-04-04 Thread Cameron Simpson
On 04Apr2012 22:23, PJ Eby wrote: | On Apr 4, 2012 7:28 PM, "Victor Stinner" wrote: | > More details why it's hard to define such function and why I dropped | > it from the PEP. | > | > If someone wants to propose again such function ("monotonic or | > fallback to system" clock), two issues shoul

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

2012-04-04 Thread Nick Coghlan
On Thu, Apr 5, 2012 at 1:41 PM, Cameron Simpson wrote: > It was pointed out (by Nick Coglan I think?) that if the system clock > stepped backwards then a timeout would be extended by at least that > long. Guido pointed it out (it was in a reply to me, though). Cheers, Nick. -- Nick Coghlan   |