[Python-ideas] datetime.timedelta literals
Pål Grønås Drange
paal.drange at gmail.com
Sun Jun 3 17:03:43 EDT 2018
> They are more general than your proposal but they still cover pitfalls
> may affect yours. It would be better if you could expand your proposal to
> concerns raised on those threads.
After reading that thread (this summary should be taken with a grain of
the first half is concerned with dimensional analysis not (satisfactorily)
performed. The second half of the discussion is dedicated to the major
with 1E1 meaning 1 and not 1 exa, and it's also pointed out that it is
confusing that 1m means 0.001 and not 1 meter.
There is an alternative proposal from that thread, namely that we write
etc to mean milli and kilo, respectively. That could also be used in my
However, the suggested idea with _all the SI units_ is a completely new
construct over any programming language in existence; and quite frankly a
bigger change than mine. My suggestion, which is not mine at all, really,
an implementation in C++, with experiences we can learn from. The
literals" idea has _six_ new literals, whereas Ken Kundert's idea has I
know how many.
I want to highlight one comment I found enlightening, and that is one from
[Python-ideas] SI scale factors in Python
Paul Moore p.f.moore at gmail.com
Thu Aug 25 16:03:32 EDT 2016
> Python has a track record of being open to adding syntactic support if
> it demonstrably helps 3rd party tools (for example, the matrix
> multiplication operator was added specifically to help the numeric
> Python folks address a long-standing issue they had), so this is a
> genuine possibility - but such proposals need support from the groups
> they are intended to help.
I can understand that a lack of support from people using timedelta will be
Now, please don't take this as a dismissal of your suggestion that I can
from the referenced discussion; I did learn a great deal, but I also felt
much of the discussion was around subjects that are less relevant for the
"timedelta literals" suggestion.
Pål Grønås Drange
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas