Author tim.peters
Recipients Austin Bingham, christian.heimes, mark.dickinson, rhettinger, robert_smallshire, serhiy.storchaka, tim.peters
Date 2018-03-15.18:14:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1521137697.85.0.467229070634.issue26680@psf.upfronthosting.co.za>
In-reply-to
Content
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 ;-)
History
Date User Action Args
2018-03-15 18:14:57tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, christian.heimes, serhiy.storchaka, robert_smallshire, Austin Bingham
2018-03-15 18:14:57tim.peterssetmessageid: <1521137697.85.0.467229070634.issue26680@psf.upfronthosting.co.za>
2018-03-15 18:14:57tim.peterslinkissue26680 messages
2018-03-15 18:14:57tim.peterscreate