[Python-ideas] Moving calendar.timegm() to time module Was: Rename time module to "posixtime"

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Jun 16 20:14:46 CEST 2010


On Wed, Jun 16, 2010 at 1:37 PM, Brett Cannon <brett at python.org> wrote:
..
>> The only improvement I could see, would be to move
>> calendar.timegm() to the time module, since that's where
>> it belongs (keeping an alias in the calendar module, of
>> course).
>
> That should definitely happen at some point.
>

This is discussed in Issue 6280 <http://bugs.python.org/issue6280>.
There are several issues with this proposal:

1. According to help(time),

"""
    The Epoch is system-defined; on Unix, it is generally January 1st, 1970.
    The actual value can be retrieved by calling gmtime(0).
"""

Current calendar.gmtime implementation ignores this.  The solution to
this, may be to change help(time), though.

2. Current calendar.gmtime supports float values for hours, minutes
and seconds in timedelta tuple.  This is probably an unintended
implementation artifact, but it is relied upon even in stdlib.  See
http://bugs.python.org/issue6280#msg107808 .



More information about the Python-ideas mailing list