[Python-Dev] Deprecating float.is_integer()
Guido van Rossum
guido at python.org
Wed Mar 21 11:08:22 EDT 2018
I searched 6M LoC of Python code at Dropbox and found only three uses. They
seem legit. Two are about formatting a number that's given as a float,
deciding whether to print a float as 42 or 3.14. The third is attempting a
conversion from float to integer where a non-integer must raise a specific
exception (the same function also supports a string as long as it can be
parsed as an int).
I don't doubt we would get by if is_integer() was deprecated.
On Wed, Mar 21, 2018 at 3:31 AM, Chris Barker <chris.barker at noaa.gov> wrote:
>> Does anybody know examples of the correct use of float.is_integer() in
>> real programs? For now it looks just like a bug magnet. I suggest to
>> deprecate it in 3.7 or 3.8 and remove in 3.9 or 3.10.
> It really doesn’t appear to be the right solution for any problem.
> Christopher Barker, Ph.D.
> Emergency Response Division
> NOAA/NOS/OR&R (206) 526-6959 voice
> 7600 Sand Point Way NE (206) 526-6329 fax
> Seattle, WA 98115 (206) 526-6317 main reception
> Chris.Barker at noaa.gov
> Python-Dev mailing list
> Python-Dev at python.org
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev