This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jwm
Recipients georg.brandl, jwm, loewis
Date 2009-05-03.11:44:07
SpamBayes Score 7.074559e-09
Marked as misclassified No
Message-id <1241351050.85.0.713911807128.issue5907@psf.upfronthosting.co.za>
In-reply-to
Content
While it's true that repr() methods cannot generally be expected to eval
back into an object of the same type, the old repr behaviour of the
struct_time object did effectively do so. Admittedly it was a kludge due
to the time module functions originally producing a tuple before the
advent of the struct_time type, but code that expected repr->eval
behaviour worked up to 2.5. It's also evident that who ever changed the
behaviour of time.struct_time.__repr__ intended that to sill be the
case, otherwise it would have produced a string of the form <time_struct
...>

So I would describe this as a bug, otherwise you'd have to call it an
undocumented behaviour change :-)

The question remains, how to fix it? Should the repr output change to
time.struct_time((tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec,
tm_wday, tm_yday, tm_isdst)) or implement the keyword argument form?

(Note: python3.0 shares this new behaviour)
History
Date User Action Args
2009-05-03 11:44:11jwmsetrecipients: + jwm, loewis, georg.brandl
2009-05-03 11:44:10jwmsetmessageid: <1241351050.85.0.713911807128.issue5907@psf.upfronthosting.co.za>
2009-05-03 11:44:09jwmlinkissue5907 messages
2009-05-03 11:44:08jwmcreate