[Python-Dev] Deprecating float.is_integer() (original) (raw)
Kirill Balunov kirillbalunov at gmail.com
Thu Mar 22 14:59:27 EDT 2018
- Previous message (by thread): [Python-Dev] Deprecating float.is_integer()
- Next message (by thread): [Python-Dev] Deprecating float.is_integer()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2018-03-22 19:47 GMT+03:00 Tim Peters <tim.peters at gmail.com>:
> Is this functionality so often used and practical to be a method of float, > int, ..., and not just to be an auxiliary function? > > p.s.: The same thoughts about
asintegerratio
discussion. I would have added them as functions in themath
module instead. perhaps supported by dunder methods (asintegerratio, isinteger). But that's not what happened, and whether or not they have double underscores on each end doesn't really make all that much difference except to dedicated pedants ;-)
Yes, this was my point. In spite of the fact that the pronouncement has
already been made, there may still be an opportunity to influence this
decision. I do not think that this is only a matter of choice, how this
functionality will be accessed through a method or function, in fact these
highly specialized methods heavily pollute the API and open the door for
persistent questions. Given the frequency and activity of using this
.is_integer
method the deprecation of this method is unlikely to greatly
affect someone. (for as_integer_ratio
I think the bar is
higher). Summarizing this thread it seems to me that with deprecation of
is_integer
method and with addition of is_integer
function in math
module will make everyone happy:
PROS:
- Those who do not like this method, and do not want to see it as a
redundant part of
int
, ... will be happy - Those who need it will have this functionality through math module
- Compatible packages do not have to quack louder
- Cleaner API (no need to add this through numeric tower)
- Make everyone happy and stop this thread :)
CONS:
- Backward incompatible change
I do not want to restart this topic, but I think that there is an opportunity for improvement that can be missed.
With kind regards, -gdg -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20180322/7d6bcf0f/attachment-0001.html>
- Previous message (by thread): [Python-Dev] Deprecating float.is_integer()
- Next message (by thread): [Python-Dev] Deprecating float.is_integer()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]