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

2012-04-05 Thread Lennart Regebro
On Thu, Apr 5, 2012 at 00:45, Greg Ewing greg.ew...@canterbury.ac.nz wrote: 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

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

2012-04-05 Thread Lennart Regebro
On Thu, Apr 5, 2012 at 01:10, Victor Stinner victor.stin...@gmail.com wrote: 2012/4/4 Lennart Regebro rege...@gmail.com: On Wed, Apr 4, 2012 at 13:04, Victor Stinner victor.stin...@gmail.com wrote: It depends if the option supports other values. But as I understood, the keyword value must

Re: [Python-Dev] cpython: Issue #3033: Add displayof parameter to tkinter font.

2012-04-05 Thread Antoine Pitrou
On Thu, 05 Apr 2012 11:41:48 +0200 andrew.svetlov python-check...@python.org wrote: http://hg.python.org/cpython/rev/774c2afa6665 changeset: 76115:774c2afa6665 user:Andrew Svetlov andrew.svet...@gmail.com date:Thu Apr 05 12:41:20 2012 +0300 summary: Issue #3033: Add

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

2012-04-05 Thread Victor Stinner
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. Well, in timings it is an

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

2012-04-05 Thread Victor Stinner
2012/4/5 PJ Eby p...@telecommunity.com: 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  - description of the

Re: [Python-Dev] cpython: Issue #3033: Add displayof parameter to tkinter font.

2012-04-05 Thread Andrew Svetlov
Maybe you will be surprised, but tkinter.rst has no comprehensive docs for any tkinter class. I like to get it fixed but definitely cannot do it myself. My very poor English is the main objection for writing narrative documentation. On Thu, Apr 5, 2012 at 1:21 PM, Antoine Pitrou

[Python-Dev] FS: [issue9141] Allow objects to decide if they can be collected by GC

2012-04-05 Thread Kristján Valur Jónsson
Hi there. Antoine Pitrou suggested that I float this on python-dev again. The new patch should 1) be much simpler and less hacky 2) remove the special case code for PyGenObject from gcmodule.c K Frá: Kristján Valur Jónsson [rep...@bugs.python.org] Sent:

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

2012-04-05 Thread Stephen J. Turnbull
On Thu, Apr 5, 2012 at 8:05 AM, Oleg Broytman p...@phdru.name wrote:   Well, I am partially retreat. Errors should never pass silently. Unless explicitly silenced. get_clock(FLAG, on_error=None) could return None. I still don't see what's erroneous about returning None when asked for an object

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

2012-04-05 Thread Oleg Broytman
On Thu, Apr 05, 2012 at 10:06:38PM +0900, Stephen J. Turnbull wrote: On Thu, Apr 5, 2012 at 8:05 AM, Oleg Broytman p...@phdru.name wrote:   Well, I am partially retreat. Errors should never pass silently. Unless explicitly silenced. get_clock(FLAG, on_error=None) could return None. I

Re: [Python-Dev] cpython: Issue #3033: Add displayof parameter to tkinter font.

2012-04-05 Thread R. David Murray
(reformatted to remove topposting) On Thu, 05 Apr 2012 14:52:56 +0300, Andrew Svetlov andrew.svet...@gmail.com wrote: On Thu, Apr 5, 2012 at 1:21 PM, Antoine Pitrou solip...@pitrou.net wrote: On Thu, 05 Apr 2012 11:41:48 +0200 andrew.svetlov python-check...@python.org wrote:

Re: [Python-Dev] cpython: Issue #3033: Add displayof parameter to tkinter font.

2012-04-05 Thread Andrew Svetlov
Thank you, David. Is separate repo clone located at hg.python.org good enough? Or maybe there are better way to do it? On Thu, Apr 5, 2012 at 5:06 PM, R. David Murray rdmur...@bitdance.com wrote: (reformatted to remove topposting) On Thu, 05 Apr 2012 14:52:56 +0300, Andrew Svetlov

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

2012-04-05 Thread Stephen J. Turnbull
On Thu, Apr 5, 2012 at 10:34 PM, Oleg Broytman p...@phdru.name wrote:   Why doesn't open() return None for a non-existing file? or socket.gethostbyname() for a non-existing name? That's not an answer to my question, because those calls have very important use cases where the user knows the

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

2012-04-05 Thread Oleg Broytman
On Thu, Apr 05, 2012 at 11:45:06PM +0900, Stephen J. Turnbull wrote: On Thu, Apr 5, 2012 at 10:34 PM, Oleg Broytman p...@phdru.name wrote:   Why doesn't open() return None for a non-existing file? or socket.gethostbyname() for a non-existing name? That's not an answer to my question,

Re: [Python-Dev] cpython: Issue #3033: Add displayof parameter to tkinter font.

2012-04-05 Thread R. David Murray
On Thu, 05 Apr 2012 17:34:07 +0300, Andrew Svetlov andrew.svet...@gmail.com wrote: Thank you, David. Is separate repo clone located at hg.python.org good enough? Or maybe there are better way to do it? That sounds like a good plan to me. --David

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

2012-04-05 Thread R. David Murray
On Thu, 05 Apr 2012 19:22:17 +0400, Oleg Broytman p...@phdru.name wrote: On Thu, Apr 05, 2012 at 11:45:06PM +0900, Stephen J. Turnbull wrote: On Thu, Apr 5, 2012 at 10:34 PM, Oleg Broytman p...@phdru.name wrote:   Why doesn't open() return None for a non-existing file? or

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

2012-04-05 Thread Ethan Furman
Cameron Simpson wrote: On 04Apr2012 22:23, PJ Eby p...@telecommunity.com wrote: | On Apr 4, 2012 7:28 PM, Victor Stinner victor.stin...@gmail.com 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

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

2012-04-05 Thread Oleg Broytman
On Thu, Apr 05, 2012 at 07:22:17PM +0400, Oleg Broytman wrote: On Thu, Apr 05, 2012 at 11:45:06PM +0900, Stephen J. Turnbull wrote: find it hard to imagine use cases where file = open(thisfile) or open(thatfile) makes sense. Not even for the case where thisfile == 'script.pyc' and

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

2012-04-05 Thread Oleg Broytman
On Thu, Apr 05, 2012 at 11:38:13AM -0400, R. David Murray wrote: Do you really think we need to add a third clock function (the query function) that just returns True or False? Maybe we do, if actually creating the clock could raise an error even if exists, as is the case for 'open'. May

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

2012-04-05 Thread Antoine Pitrou
On Thu, 05 Apr 2012 08:32:22 -0700 Ethan Furman et...@stoneleaf.us wrote: Steven D'Aprano's synthetic clock is able to partially avoid that situation -- worst case is a timeout of double what you asked for -- so 10 seconds instead of 5 (which is much better than 3600!). The remaining issue

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

2012-04-05 Thread PJ Eby
On Wed, Apr 4, 2012 at 11:41 PM, Cameron Simpson c...@zip.com.au wrote: On 04Apr2012 22:23, PJ Eby p...@telecommunity.com wrote: | On Apr 4, 2012 7:28 PM, Victor Stinner victor.stin...@gmail.com wrote: | More details why it's hard to define such function and why I dropped | it from the

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

2012-04-05 Thread PJ Eby
On Thu, Apr 5, 2012 at 6:34 AM, Victor Stinner victor.stin...@gmail.comwrote: 2012/4/5 PJ Eby p...@telecommunity.com: 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

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

2012-04-05 Thread Guido van Rossum
On Thu, Apr 5, 2012 at 9:48 AM, PJ Eby p...@telecommunity.com wrote: On Thu, Apr 5, 2012 at 6:34 AM, Victor Stinner victor.stin...@gmail.com wrote: 2012/4/5 PJ Eby p...@telecommunity.com: More details why it's hard to define such function and why I dropped it from the PEP. If someone

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

2012-04-05 Thread Antoine Pitrou
On Thu, 5 Apr 2012 09:56:19 -0700 Guido van Rossum gu...@python.org wrote: For timeout purposes in a single process, such a clock is useful.  It just isn't suitable for benchmarks, or for interprocess coordination. I think it would be better if the proposed algorithm (or whatever

Re: [Python-Dev] cpython: Issue #3033: Add displayof parameter to tkinter font.

2012-04-05 Thread Terry Reedy
On 4/5/2012 10:06 AM, R. David Murray wrote: (reformatted to remove topposting) On Thu, 05 Apr 2012 14:52:56 +0300, Andrew Svetlovandrew.svet...@gmail.com wrote: On Thu, Apr 5, 2012 at 1:21 PM, Antoine Pitrousolip...@pitrou.net wrote: Aren't there any docs? Maybe you will be surprised,

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

2012-04-05 Thread Victor Stinner
For timeout purposes in a single process, such a clock is useful.  It just isn't suitable for benchmarks, or for interprocess coordination. I think it would be better if the proposed algorithm (or whatever algorithm to fix timeouts) was implemented by the application/library code using the

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

2012-04-05 Thread Ethan Furman
Victor Stinner wrote: I changed time.monotonic() to not fallback to the system clock exactly for this reason: Python cannot guess what the developer expects, or how the developer will use the clock. Which is exactly why I like Cameron Simpson's approach to selecting a clock -- let the

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

2012-04-05 Thread PJ Eby
On Thu, Apr 5, 2012 at 12:56 PM, Guido van Rossum gu...@python.org wrote: Depending on the polling frequency sounds like a bad idea, since you can't know that you're the only user of the clock. Also depending on the use case, too short a timeout may be worse than too long a timeout. Given a

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

2012-04-05 Thread Zooko Wilcox-O'Hearn
Folks: Good job, Victor Stinner on baking the accumulated knowledge of this thread into PEP 418. Even though I'm very interested in the topic, I haven't been able to digest the whole thread(s) on the list and understand what the current collective understanding is. The detailed PEP document helps

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

2012-04-05 Thread Ethan Furman
Oleg Broytman wrote: On Wed, Apr 04, 2012 at 12:52:00PM -0700, Ethan Furman wrote: Forced? I do not use Python to be forced to use one style of programming over another. Then it's strange you are using Python with its strict syntax (case-sensitivity, forced indents), ubiquitous

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

2012-04-05 Thread Oleg Broytman
On Thu, Apr 05, 2012 at 11:56:00AM -0700, Ethan Furman wrote: It's only an error if it's documented that way and, more importantly, thought of that way. The re module is a good example: if it can't find what you're looking for it returns None -- it does *not* raise a NotFound exception.

Re: [Python-Dev] cpython: Issue #3033: Add displayof parameter to tkinter font.

2012-04-05 Thread Andrew Svetlov
On Thu, Apr 5, 2012 at 8:19 PM, Terry Reedy tjre...@udel.edu wrote: I have been hoping to work on a proper tkinter doc. I discovered some time ago through the pydoc server (not currently working for me, see http://bugs.python.org/issue14512) that their are doc strings for (most) everything. I

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

2012-04-05 Thread Ethan Furman
Oleg Broytman wrote: On Thu, Apr 05, 2012 at 11:56:00AM -0700, Ethan Furman wrote: It's only an error if it's documented that way and, more importantly, thought of that way. The re module is a good example: if it can't find what you're looking for it returns None -- it does *not* raise a

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

2012-04-05 Thread Cameron Simpson
On 05Apr2012 03:05, Oleg Broytman p...@phdru.name wrote: | On Wed, Apr 04, 2012 at 12:52:00PM -0700, Ethan Furman wrote: | Forced? I do not use Python to be forced to use one style of | programming over another. | |Then it's strange you are using Python with its strict syntax |

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

2012-04-05 Thread Cameron Simpson
On 06Apr2012 00:15, Oleg Broytman p...@phdru.name wrote: |So we can argue in circles both ways, there are too many arguments | pro and contra. Python is just too inconsistent to be consistently | argued over. ;-) Bah! I think these threads demonstrate that we can consistently argue over

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

2012-04-05 Thread Cameron Simpson
On 05Apr2012 10:21, Lennart Regebro rege...@gmail.com wrote: | On Thu, Apr 5, 2012 at 01:10, Victor Stinner victor.stin...@gmail.com wrote: | Ok for the default, but what happens if the caller sets an option to | False? Does get_clock(monotonic=False) return a non-monotonic clock? | (I guess

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

2012-04-05 Thread Cameron Simpson
On 05Apr2012 09:56, Guido van Rossum gu...@python.org wrote: | On Thu, Apr 5, 2012 at 9:48 AM, PJ Eby p...@telecommunity.com wrote: | What's missing is that if you're using a monotonic clock for timeouts, then | a monotonically-adjusted system clock can do that, subject to the polling |

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

2012-04-05 Thread Victor Stinner
Le 06/04/2012 00:17, Cameron Simpson a écrit : This is where the bitmap approach can be less confusing - the docstring says The returned clock shall have all the requested flags. It is at least very predictable. By the way, I removed (deferred) the time.highres() function from the PEP, and I

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

2012-04-05 Thread Cameron Simpson
On 05Apr2012 13:39, Zooko Wilcox-O'Hearn zo...@zooko.com wrote: | Good job, Victor Stinner on baking the accumulated knowledge of this | thread into PEP 418. Even though I'm very interested in the topic, I | haven't been able to digest the whole thread(s) on the list and | understand what the

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

2012-04-05 Thread Cameron Simpson
On 06Apr2012 00:27, Victor Stinner victor.stin...@gmail.com wrote: | Le 06/04/2012 00:17, Cameron Simpson a écrit : | This is where the bitmap approach can be less confusing - the docstring | says The returned clock shall have all the requested flags. It is at | least very predictable. | | By

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

2012-04-05 Thread Eric Snow
On Apr 5, 2012 11:01 AM, Guido van Rossum gu...@python.org wrote: I think it would be better if the proposed algorithm (or whatever algorithm to fix timeouts) was implemented by the application/library code using the timeout (or provided as a separate library function), rather than by the

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

2012-04-05 Thread Cameron Simpson
On 06Apr2012 08:51, I wrote: | On 06Apr2012 00:27, Victor Stinner victor.stin...@gmail.com wrote: | | By the way, I removed (deferred) the time.highres() function from the | | PEP, | | Chuckle; was not the whole PEP for a high res clock? Gah. I see it was for montonic, not high res. Sorry.

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

2012-04-05 Thread Greg Ewing
Cameron Simpson wrote: A monotonic clock never returns t0 t1 for t0, t1 being two adjacent polls of the clock. On its own it says nothing about steadiness or correlation with real world time. No, no, no. This is the strict mathematical meaning of the word monotonic, but the way it's used in

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

2012-04-05 Thread Cameron Simpson
On 06Apr2012 13:14, Greg Ewing greg.ew...@canterbury.ac.nz wrote: | Cameron Simpson wrote: | A monotonic clock never returns t0 t1 for t0, t1 being two adjacent | polls of the clock. On its own it says nothing about steadiness or | correlation with real world time. | | No, no, no. | This is

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

2012-04-05 Thread Steven D'Aprano
Greg Ewing wrote: Cameron Simpson wrote: A monotonic clock never returns t0 t1 for t0, t1 being two adjacent polls of the clock. On its own it says nothing about steadiness or correlation with real world time. No, no, no. This is the strict mathematical meaning of the word monotonic, but

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

2012-04-05 Thread Stephen J. Turnbull
On Fri, Apr 6, 2012 at 12:22 AM, Oleg Broytman p...@phdru.name wrote: On Thu, Apr 05, 2012 at 11:45:06PM +0900, Stephen J. Turnbull wrote: On Thu, Apr 5, 2012 at 10:34 PM, Oleg Broytman p...@phdru.name wrote:   Why doesn't open() return None for a non-existing file? or socket.gethostbyname()

[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-05 Thread Zooko Wilcox-O'Hearn
On Thu, Apr 5, 2012 at 7:14 PM, Greg Ewing greg.ew...@canterbury.ac.nz wrote: This is the strict mathematical meaning of the word monotonic, but the way it's used in relation to OS clocks, it seems to mean rather more than that. Yep. As far as I can tell, nobody has a use for an unsteady,

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-05 Thread Cameron Simpson
On 05Apr2012 21:07, Zooko Wilcox-O'Hearn zo...@zooko.com wrote: | On Thu, Apr 5, 2012 at 7:14 PM, Greg Ewing greg.ew...@canterbury.ac.nz wrote: | This is the strict mathematical meaning of the word monotonic, | but the way it's used in relation to OS clocks, it seems to mean rather | more than

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-05 Thread Steven D'Aprano
Cameron Simpson wrote: | The main reason to use the word monotonic clock to refer to the | second concept is that POSIX does so, but since Mac OS X, Solaris, | Windows, and C++ have all avoided following POSIX's mistake, I think | Python should too. No. If it is not monotonic, DO NOT CALL 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-05 Thread Cameron Simpson
On 06Apr2012 14:31, Steven D'Aprano st...@pearwood.info wrote: | Cameron Simpson wrote: | | The main reason to use the word monotonic clock to refer to the | | second concept is that POSIX does so, but since Mac OS X, Solaris, | | Windows, and C++ have all avoided following POSIX's mistake, I