homepage

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 musically_ut
Recipients belopolsky, musically_ut, serhiy.storchaka
Date 2017年05月07日.20:58:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1494190699.86.0.0761226669728.issue30302@psf.upfronthosting.co.za>
In-reply-to
Content
> The drawback is that this change increases the length of the repr.
I would argue that it is a reasonable trade-off given the increase in ease of understanding. 
I know that this is a weak argument, but, keywords are not without precedent. Consider the comically more verbose example:
import time
time.gmtime(1121871596)
# time.struct_time(tm_year=2005, tm_mon=7, tm_mday=20, tm_hour=14, tm_min=59, tm_sec=56, tm_wday=2, tm_yday=201, tm_isdst=0)
> datetime.datetime has more arguments, and its repr doesn't use keywords.
I think that guessing the meaning of values is much harder when it comes to timedelta.
> Users of datetime.timedelta know what arguments mean. If they don't know they always can look in the documentation or builtin help.
I created the issue after ... a friend ... spent an embarrassing amount of time debugging because he thought that the third argument represented milliseconds and not microseconds. <_<
I could, of course, tell him:
> In the face of ambiguity, resist the temptation to guess.
But he could retort:
> Explicit is better than implicit.
and 
> Readability counts.
I think he has a point.
History
Date User Action Args
2017年05月07日 20:58:19musically_utsetrecipients: + musically_ut, belopolsky, serhiy.storchaka
2017年05月07日 20:58:19musically_utsetmessageid: <1494190699.86.0.0761226669728.issue30302@psf.upfronthosting.co.za>
2017年05月07日 20:58:19musically_utlinkissue30302 messages
2017年05月07日 20:58:19musically_utcreate

AltStyle によって変換されたページ (->オリジナル) /