[Python-ideas] Rename time module to "posixtime"

Alexander Belopolsky alexander.belopolsky at gmail.com
Tue Jun 15 02:09:02 CEST 2010


One of the common complains about working with time values in Python,
is that it some functionality is available in time module, some in
datetime module and some in both.

I propose a series of steps towards improving this situation.

1. Create posixtime.py initially containing just  "from time import *"
2. Add python implementation of time.* functions to posixtime.py.
3. Rename time module to _posixtime and add time.py with a deprecation
warning and "from _posixtime import *".

Note that #2 may require to move some code from timemodule.c to
datetimemodule.c, but at the binary level code compiled from these
files is already linked together in datetimemodule.  Moving the
necessary code to datetime.c will help to eliminate current circular
dependency between time and datetime.



More information about the Python-ideas mailing list