[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)

Steven D'Aprano steve at pearwood.info
Fri Apr 6 06:31:22 CEST 2012


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 monotonic. Call it steady,
> perhaps, if it _is_ steady (within some threshold of course).

Um, steady is a stronger promise than monotonic. This is a monotonic sequence:

1, 2, 99, 100, 101, 102, 103, 199, 200, 201, 999

But it isn't steady, because it jumps forward.

Here is a non-monotonic sequence:

1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 8

This isn't steady either, because it jumps backwards.

To be steady, it MUST also be monotonic. If you think that it is appropriate 
to call a non-monotonic clock "steady", then I think you should tell us what 
you mean by "steady but not monotonic".



-- 
Steven


More information about the Python-Dev mailing list