◐ Shell
reader mode source ↗
Skip to content

bpo-30302 Make timedelta.__repr__ more informative.#1493

Merged
vstinner merged 26 commits into
python:masterfrom
musically-ut:feat-timedelta-repr
Jul 25, 2017
Merged

bpo-30302 Make timedelta.__repr__ more informative.#1493
vstinner merged 26 commits into
python:masterfrom
musically-ut:feat-timedelta-repr

Conversation

@musically-ut

@musically-ut musically-ut commented May 7, 2017

Copy link
Copy Markdown
Contributor

Currently, the default implementation of datetime.datetime.repr (the default output string produced at the console/IPython) gives a rather cryptic output:

from datetime import datetime as D
D.fromtimestamp(1390953543.1) - D.fromtimestamp(1121871596)
# datetime.timedelta(3114, 28747, 100000)

For the uninitiated, it is not obvious that the numeric values here are days, seconds and microsecond respectively.

Would there be any pushback against changing this to:

# datetime.timedelta(days=3114, seconds=28747, microseconds=100000)

?

https://bugs.python.org/issue30302

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants