[Python-Dev] Python strptime

Brett Cannon bac@OCF.Berkeley.EDU
Mon, 17 Jun 2002 14:31:35 -0700 (PDT)


On Mon, 17 Jun 2002, Guido van Rossum wrote:

> > I have implemented strptime in pure Python (SF patch #474274) as a drop-in
> > replacement for the time module's version, but there is the issue of the
> > time module being a C extension.  Any chance of getting a Python module
> > stub for time (assuming this patch is good enough to be accepted)?
> >
> > There is also obviously the option of doing something like a time2, but is
> > there enough other time-manipulating Python code out there to warrant
> > another module?  It could be used for housing naivetime and any other code
> > that does not directly stem from some ANSI C function.
>
> I think this should be done, but I have no time to review your
> strptime implementation.  Can you submit (to the same patch item) a
> patch for timemodule.c that adds a callout to your Python strptime
> code when HAVE_STRPTIME is undefined?

Do you just want a callout to strptime or should I also include my helper
classes and functions?  I have implemented a class that figures out and
stores all locale-specific date info (weekday names, month names, etc.).
I subclass that for another class that creates the regexes used by
strptime.  I also have three functions that calculate missing data (Julian
date from Gregorian date, etc.).

But one does not need access to any of these things directly if one just
wants to use strptime like in the time module, so they can be left out for
now if you prefer.

>
> --Guido van Rossum (home page: http://www.python.org/~guido/)
>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> http://mail.python.org/mailman/listinfo/python-dev
>


-Brett C.