[issue19475] Inconsistency between datetime's str()/isoformat() and its strptime() method

Guido van Rossum report at bugs.python.org
Fri Nov 1 19:40:37 CET 2013


Guido van Rossum added the comment:

Well, I don't know if this sways anything, but I was probably responsible, and I think my argument was something about not all timestamp sources having microseconds, and not wanting to emit the ".000000" in that case. If I could go back I'd probably do something else; after all str(1.0) doesn't return '1' either. But that's water under the bridge; "fixing" this is undoubtedly going to break a lot of code.

Maybe we can give isoformat() a flag parameter to force the inclusion or exclusion of the microseconds (with a default of None meaning the current behavior)?

----------
nosy: +gvanrossum
resolution: duplicate -> 
status: closed -> open

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


More information about the Python-bugs-list mailing list