[Python-Dev] User's complaints

skip at pobox.com skip at pobox.com
Wed Jul 12 13:13:47 CEST 2006


    >> Python 2.3:
    >> 
    >> >>> import time
    >> >>> time.strftime("%Y-%m-%d", (2005, 6, 4) + (0,)*6)
    >> '2005-06-04'

    Martin> Is there any specific reason you couldn't write

    Martin> "%d-%02d-%02d" % (2005, 6, 4)

    Martin> (i.e. not use strftime at all)?

Sure, but that was just me being lazy typing at the interactive prompt.
%Y-%m-%d is just about the only date format I can ever remember without
consulting the strftime(3) man page. ;-)  Suppose I had used

    >>> time.strftime("%b %d, %Y", (2005, 6, 4) + (1,)*6)
    'Jun 04, 2005'

instead (switching to the all-ones default that still works)?

    Martin> So this was changed in response to a bug report about a crash.

Yeah, but it broke common (at the time) usage.

Skip


More information about the Python-Dev mailing list