Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev

time.clock_info() field names

 

 

Python dev RSS feed   Index | Next | Previous | View Threaded


benjamin at python

Apr 29, 2012, 4:25 PM

Post #1 of 13 (837 views)
Permalink
time.clock_info() field names

Hi,
I see PEP 418 gives time.clock_info() two boolean fields named
"is_monotonic" and "is_adjusted". I think the "is_" is unnecessary and
a bit ugly, and they could just be renamed "monotonic" and "adjusted".

Thoughts?

--
Regards,
Benjamin
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


solipsis at pitrou

Apr 29, 2012, 4:33 PM

Post #2 of 13 (826 views)
Permalink
Re: time.clock_info() field names [In reply to]

On Sun, 29 Apr 2012 19:25:16 -0400
Benjamin Peterson <benjamin [at] python> wrote:
> Hi,
> I see PEP 418 gives time.clock_info() two boolean fields named
> "is_monotonic" and "is_adjusted". I think the "is_" is unnecessary and
> a bit ugly, and they could just be renamed "monotonic" and "adjusted".
>
> Thoughts?

Agreed.

cheers

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


jimjjewett at gmail

Apr 29, 2012, 6:06 PM

Post #3 of 13 (823 views)
Permalink
time.clock_info() field names [In reply to]

In http://mail.python.org/pipermail/python-dev/2012-April/119134.html
Benjamin Peterson wrote:

> I see PEP 418 gives time.clock_info() two boolean fields named
> "is_monotonic" and "is_adjusted". I think the "is_" is unnecessary and
> a bit ugly, and they could just be renamed "monotonic" and "adjusted".

I agree with monotonic, but I think it should be "adjustable".

To me, "adjusted" and "is_adjusted" both imply that an adjustment
has already been made; "adjustable" only implies that it is possible.

I do remember concerns (including Stephen J. Turnbull's
<CAL_0O19nmi0+zB+tV8poZDAffNdTnohxo9y5dbw+E2q=9rX9YA [at] mail> )
that "adjustable" should imply at least a list of past adjustments,
and preferably a way to make an adjustment.

I just think that stating it is adjustable (without saying how, or
whether and when it already happened) is less wrong than claiming it
is already adjusted just in case it might have been.

-jJ

--

If there are still threading problems with my replies, please
email me with details, so that I can try to resolve them. -jJ

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


benjamin at python

Apr 29, 2012, 6:31 PM

Post #4 of 13 (819 views)
Permalink
Re: time.clock_info() field names [In reply to]

2012/4/29 Jim J. Jewett <jimjjewett [at] gmail>:
>
>
> In http://mail.python.org/pipermail/python-dev/2012-April/119134.html
> Benjamin Peterson wrote:
>
>> I see PEP 418 gives time.clock_info() two boolean fields named
>> "is_monotonic" and "is_adjusted". I think the "is_" is unnecessary and
>> a bit ugly, and they could just be renamed "monotonic" and "adjusted".
>
> I agree with monotonic, but I think it should be "adjustable".

I don't really care, but I think "adjusted" is fine. As in "this clock
is adjusted (occasionally)".


--
Regards,
Benjamin
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


mark at hotpy

Apr 30, 2012, 1:26 AM

Post #5 of 13 (820 views)
Permalink
Re: time.clock_info() field names [In reply to]

Benjamin Peterson wrote:
> 2012/4/29 Jim J. Jewett <jimjjewett [at] gmail>:
>>
>> In http://mail.python.org/pipermail/python-dev/2012-April/119134.html
>> Benjamin Peterson wrote:
>>
>>> I see PEP 418 gives time.clock_info() two boolean fields named
>>> "is_monotonic" and "is_adjusted". I think the "is_" is unnecessary and
>>> a bit ugly, and they could just be renamed "monotonic" and "adjusted".
>> I agree with monotonic, but I think it should be "adjustable".
>
> I don't really care, but I think "adjusted" is fine. As in "this clock
> is adjusted (occasionally)".

monotonic is an adjective, whereas adjusted is (part of) a verb. I think
both should be adjectives. Does "adjusted" mean that it has been
adjusted, that it can be adjusted or it will be adjusted?

Cheers,
Mark.
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


cs at zip

Apr 30, 2012, 4:06 AM

Post #6 of 13 (818 views)
Permalink
Re: time.clock_info() field names [In reply to]

On 29Apr2012 21:31, Benjamin Peterson <benjamin [at] python> wrote:
| 2012/4/29 Jim J. Jewett <jimjjewett [at] gmail>:
| > In http://mail.python.org/pipermail/python-dev/2012-April/119134.html
| > Benjamin Peterson wrote:
| >
| >> I see PEP 418 gives time.clock_info() two boolean fields named
| >> "is_monotonic" and "is_adjusted". I think the "is_" is unnecessary and
| >> a bit ugly, and they could just be renamed "monotonic" and "adjusted".
| >
| > I agree with monotonic, but I think it should be "adjustable".
|
| I don't really care, but I think "adjusted" is fine. As in "this clock
| is adjusted (occasionally)".

-1 on "adjustable". That suggests the user can adjust it, not that the
OS may adjust it.

+1 on "adjusted" over "is_adjusted".
--
Cameron Simpson <cs [at] zip> DoD#743
http://www.cskk.ezoshosting.com/cs/

Winter is gods' way of telling us to polish.
- Peter Harper <bo165 [at] freenet> <harperp [at] algonquinc>
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


cs at zip

Apr 30, 2012, 4:09 AM

Post #7 of 13 (815 views)
Permalink
Re: time.clock_info() field names [In reply to]

On 30Apr2012 09:26, Mark Shannon <mark [at] hotpy> wrote:
| monotonic is an adjective,

Yes.

| whereas adjusted is (part of) a verb.

No. It is an adjective.

| I think
| both should be adjectives. Does "adjusted" mean that it has been
| adjusted, that it can be adjusted or it will be adjusted?

That depends on context. Reach for the doco.

Of course, in the context of the PEP means "may be adjusted by exterior clock
maintenance like NTP, and in fact this may have already happened". I am
unhappy with that filled with underscores and used as the name:-(

Cheers,
--
Cameron Simpson <cs [at] zip> DoD#743
http://www.cskk.ezoshosting.com/cs/

Experience is what you get when you don't get what you want.
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


benjamin at python

May 1, 2012, 6:38 AM

Post #8 of 13 (817 views)
Permalink
Re: time.clock_info() field names [In reply to]

I've now renamed "is_monotonic" to "monotonic" and "is_adjusted" to "adjusted".

2012/4/29 Benjamin Peterson <benjamin [at] python>:
> Hi,
> I see PEP 418 gives time.clock_info() two boolean fields named
> "is_monotonic" and "is_adjusted". I think the "is_" is unnecessary and
> a bit ugly, and they could just be renamed "monotonic" and "adjusted".
>
> Thoughts?
>
> --
> Regards,
> Benjamin



--
Regards,
Benjamin
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


victor.stinner at gmail

May 3, 2012, 4:47 PM

Post #9 of 13 (809 views)
Permalink
Re: time.clock_info() field names [In reply to]

> To me, "adjusted" and "is_adjusted" both imply that an adjustment
> has already been made; "adjustable" only implies that it is possible.

The documentation is:

"True if the clock can be adjusted (e.g. by a NTP daemon), False otherwise."

I prefer "adjustable", because no OS tell us if the clock has an
ajustement or not... except Windows: see GetSystemTimeAdjustment().
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724394%28v=vs.85%29.aspx

I propose to rename is_adjusted (which is now called adjusted) to
adjustable, and not use GetSystemTimeAdjustment() on Windows but
hardcode the value to True for the system clock, False for other
functions (GetTick, QueryPerformanceCounter, ...).

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


cs at zip

May 3, 2012, 5:12 PM

Post #10 of 13 (808 views)
Permalink
Re: time.clock_info() field names [In reply to]

On 04May2012 01:47, Victor Stinner <victor.stinner [at] gmail> wrote:
| I prefer "adjustable", because no OS tell us if the clock has an
| ajustement or not... except Windows: see GetSystemTimeAdjustment().
| http://msdn.microsoft.com/en-us/library/windows/desktop/ms724394%28v=vs.85%29.aspx
|
| I propose to rename is_adjusted (which is now called adjusted) to
| adjustable,

I'm -1 on that. To my mind "adjustable" suggests that the caller can
adjust the clock, while "adjusted" suggests that the clock may be adjusted
by a mechanism outside the caller's hands. That latter is the meaning
in the context of the PEP.

Cheers,
--
Cameron Simpson <cs [at] zip> DoD#743
http://www.cskk.ezoshosting.com/cs/

I'm not making any of this up you know. - Anna Russell
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


victor.stinner at gmail

May 3, 2012, 5:21 PM

Post #11 of 13 (805 views)
Permalink
Re: time.clock_info() field names [In reply to]

> I'm -1 on that. To my mind "adjustable" suggests that the caller can
> adjust the clock, while "adjusted" suggests that the clock may be adjusted
> by a mechanism outside the caller's hands. That latter is the meaning
> in the context of the PEP.

Anyway, the implementation and/or the documentation is buggy and
should be fixed (especially the Windows case).

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


ncoghlan at gmail

May 3, 2012, 5:44 PM

Post #12 of 13 (807 views)
Permalink
Re: time.clock_info() field names [In reply to]

On Fri, May 4, 2012 at 10:12 AM, Cameron Simpson <cs [at] zip> wrote:
> On 04May2012 01:47, Victor Stinner <victor.stinner [at] gmail> wrote:
> | I prefer "adjustable", because no OS tell us if the clock has an
> | ajustement or not... except Windows: see GetSystemTimeAdjustment().
> | http://msdn.microsoft.com/en-us/library/windows/desktop/ms724394%28v=vs.85%29.aspx
> |
> | I propose to rename is_adjusted (which is now called adjusted) to
> | adjustable,
>
> I'm -1 on that. To my mind "adjustable" suggests that the caller can
> adjust the clock, while "adjusted" suggests that the clock may be adjusted
> by a mechanism outside the caller's hands. That latter is the meaning
> in the context of the PEP.

+1

The connotations of "adjusted" and "adjustable" are slightly different
and, in this case, "adjusted" is a better fit. The fact that
"adjusted" may be misinterpreted as "this clock has been adjusted in
the past" (incorrectly leaving out the "and/or may be adjusted in the
future" part) is still closer to the mark than the likely
misinterpretation of "adjustable" as meaning "can be adjusted directly
by the application" (which is simply false, unless the application
starts tinkering with the relevant platform specific time
configuration interfaces, which aren't exposed by the standard
library).

Regards,
Nick.

--
Nick Coghlan   |   ncoghlan [at] gmail   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


victor.stinner at gmail

Jun 12, 2012, 2:03 PM

Post #13 of 13 (736 views)
Permalink
Re: time.clock_info() field names [In reply to]

2012/5/4 Victor Stinner <victor.stinner [at] gmail>:
> Anyway, the implementation and/or the documentation is buggy and
> should be fixed (especially the Windows case).

Done, I renamed "adjusted" to "adjustable", fixed its value on Windows
(time.time) and Linux (time.monotonic), and updated the doc.
--
changeset: 77415:0e46e0cd368f
tag: tip
user: Victor Stinner <victor.stinner [at] gmail>
date: Tue Jun 12 22:46:37 2012 +0200
files: Doc/library/time.rst Include/pytime.h
Lib/test/test_time.py Misc/NEWS Modules/timemodule.c Python/pytime.c
description:
PEP 418: Rename adjusted attribute to adjustable in time.get_clock_info() result

Fix also its value on Windows and Linux according to its documentation:
"adjustable" indicates if the clock *can be* adjusted, not if it is or was
adjusted.

In most cases, it is not possible to indicate if a clock is or was adjusted.
--
Basically, time.get_clock_info().adjustable is only True for
time.time(). It can also be True for time.perf_counter() if
time.monotonic() is not available.

I prefer "adjustable" over "adjusted" because it is well defined and
its value is well known. For example, it is not easy to say if
time.monotonic() is "adjusted" or not on Linux, whereas I can say that
time.monotonic() is not *adjustable* on any OS.

I will update the PEP except if someone complains :-)

Sorry for being late, but I was exhausted by this PEP.

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Python dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.