Tim Peters <t...@python.org> added the comment:

Serhiy, nobody is proposing to add float.as_integer().  It already exists:

>>> (3.1).is_integer()
False

I already allowed I don't have a feel for how _generally_ useful it is, but you 
have at least my and Stefan's word for that the functionality (however spelled) 
_is_ necessary in implementing various math libraries.

If we outlawed float functions that the numerically naive may misuse, we'd have 
to remove floats entirely.

Given that it's _already in the language_, the only question here is whether to 
make it play nice with types beyond just `float`.  I expect you'd have a hard 
time constructing an example where int.is_integer() returned a misleading 
result ;-)

----------

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

Reply via email to