Message87042
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) |
|
Date |
User |
Action |
Args |
2009-05-03 11:44:11 | jwm | set | recipients:
+ jwm, loewis, georg.brandl |
2009-05-03 11:44:10 | jwm | set | messageid: <1241351050.85.0.713911807128.issue5907@psf.upfronthosting.co.za> |
2009-05-03 11:44:09 | jwm | link | issue5907 messages |
2009-05-03 11:44:08 | jwm | create | |
|