This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author taleinat
Recipients John.Yeung, facundobatista, mark.dickinson, rhettinger, serhiy.storchaka, taleinat, terry.reedy, tim.peters
Date 2018-07-29.11:08:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532862539.4.0.56676864532.issue33083@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-07-29 11:08:59taleinatsetrecipients: + taleinat, tim.peters, rhettinger, terry.reedy, facundobatista, mark.dickinson, serhiy.storchaka, John.Yeung
2018-07-29 11:08:59taleinatsetmessageid: <1532862539.4.0.56676864532.issue33083@psf.upfronthosting.co.za>
2018-07-29 11:08:59taleinatlinkissue33083 messages
2018-07-29 11:08:59taleinatcreate