[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()

Alexander Belopolsky report at bugs.python.org
Tue Feb 23 18:28:46 CET 2010


Alexander Belopolsky <alexander.belopolsky at gmail.com> added the comment:

The patch (I reviewed timemodule-gmtime-trunk.diff) looks mostly correct.  One problem that I see is that it will likely produce compiler warnings on the systems without timegm and mktime.  The warnings will be due to unused static function time_timegm and use of uninitialized variable tt.  I suggest that you wrap time_timegm in appropriate #ifdefs.

I trust that you tested that it works, but

#ifdef HAVE_TIMEGM || (defined(HAVE_MKTIME) && defined(HAVE_WORKING_TZSET))

looks like a non-standard construct to me.  I would do

#if defined(HAVE_TIMEGM) || (defined(HAVE_MKTIME) && defined(HAVE_WORKING_TZSET))

instead.

Finally, tests and documentation are needed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6280>
_______________________________________


More information about the Python-bugs-list mailing list