[issue39788] Exponential notation should return an int if it can

Marco Sulla report at bugs.python.org
Sat Feb 29 14:46:04 EST 2020


Marco Sulla <launchpad.net at marco.sulla.e4ward.com> added the comment:

All the examples you mentioned seems to me to fix code, instead of breaking it.

About 1e300**10000, it's not a bug at all. No one can stop you to full your RAM in many other ways :-D

About conventions, it does not seems to me that Python cares about other languages very much, if it's more natural for normal people to expect a result instead of a consolidated one among devs. See `1 / 2 == 0.5`, for example.

> But by your own feature request, this would return an int and your 
"feature" would bite you

You're citing the *optional* extra to the original idea. We can agree it is not a good addition at all.

I continue to think that nE+m, where n and m are integers, should return an integer. If this can break old code, I'm the first to think it should not be implemented, but I don't see any problem (yet).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39788>
_______________________________________


More information about the Python-bugs-list mailing list