[Python-Dev] strptime recapped

Skip Montanaro skip@pobox.com
Fri, 21 Jun 2002 11:36:26 -0500


    Brett> 4) location of strptime:
    Brett> Skip asked why Guido was having me write the callout patch to
    Brett> timemodule.c.  He wondered why Lib/time.py wasn't just created
    Brett> holding my code and then renaming timemodule.c to _timemodule.c
    Brett> and importing it at the end of time.py.  No response has been
    Brett> given thus far for that.

This is what's keeping me from going further.  I did run the test suite
against the latest version with no problem.  I think making the current time
module call out to a new strptime module is the wrong way to do things,
especially given past practice (socket/_socket, string/strop, etc).  I would
prefer a time.py module be created to hold Brett's strptime function.  On
import, the last thing it would try doing is to import * from _time, which
would obliterate Brett's Python version if the platform supports strptime().

    Brett> I also suggested a possible time2 where things like strptime, my
    Brett> helper fxns (calculate the Julian date from the Gregorian date,
    Brett> etc.), and things such as naivetime could be kept.  

That's well beyond the scope of this patch.  I'd rather not address it at
this point (at least not on this thread).  I'd prefer to just focus on how
best to add strptime() to platforms without a libc version.

Skip