Utkarsh Upadhyay added the comment:

> 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to