Tal Einat <talei...@gmail.com> added the comment:

As a user, I would find Mark's suggestion very confusing, accepting 
non-integral floats but not non-integral Decimals and Fractions.

I agree that ideally it should accept only integral inputs, including floats, 
but deprecating the behavior for non-integral floats has been deemed out of 
scope for this issue.  Therefore I suggest doing the same for Decimal and 
Fraction: accept them but raise a ValueError if their values aren't 
non-negative integers.

At a later point we could deprecate this behavior for all non-integer types of 
numbers.

Another alternative, which is also more acceptable IMO, is to raise TypeError 
if given anything other than an int or a float, while deprecating floats 
altogether.

----------

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

Reply via email to