I'm not sure, but it's been that way from the start. E.g., my old Dates
module returns a date's string representation via
return '%.3s %2d %.3s ' % (
self.weekday(),
self.day,
_MONTH_NAMES[self.month-1] ) + `self.year`
because self.year may be a long (so can't be converted as part of the '%'
operation).
I bet Steve's right, that it's because libc's sprintf doesn't know about
Python's long ints.
Note that
return '%.3s %2d %.3s %s' % (
self.weekday(),
self.day,
_MONTH_NAMES[self.month-1],
`self.year` )
would have worked in the above, which may or may not strike you as cleaner.
minor-inelegance-ly y'rs - tim
Tim Peters tim@ksr.com
not speaking for Kendall Square Research Corp