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 josh.r
Recipients josh.r, smarie
Date 2018-02-20.21:06:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1519160816.66.0.467229070634.issue32886@psf.upfronthosting.co.za>
In-reply-to
Content
First off, link to discussion: https://groups.google.com/d/topic/python-ideas/-3QW3cxj3ko/discussion

1. bool is already a virtual subclass of Integral since it's an actual subclass of int (which is a virtual subclass of Integral); no need to explicitly register it

2. Don't try to register numpy's types for them; doing so would mean simply having numpy installed forces it to be imported if you import numbers, even if your script never uses numpy. Let numpy add registration for the type itself.

3. If Boolean is not a subclass of Integer/Integral, why is it in the numbers module at all? The discussion seemed to suggest putting it in numbers when the idea was that Boolean would subclass Integer/Integral; if it's not numeric at all, then the numbers module doesn't make sense.

4. Obviously, it's impossible to overload the not behavior (__bool__ is called directly to get a true bool, then the result is inverted, there is no special method for handling the not keyword), so it looks like the proposal is to make __invert__ part of the interface. Except bool itself doesn't behave in a way that would make __invert__ make sense as a drop in substitution for not; ~True produces -2, ~False produces -1, in neither case does it produce a bool result, and the result is always truthy. Changing this is impractical, since it would violate the int-like behavior of bool (which has been a historical guarantee).
History
Date User Action Args
2018-02-20 21:06:56josh.rsetrecipients: + josh.r, smarie
2018-02-20 21:06:56josh.rsetmessageid: <1519160816.66.0.467229070634.issue32886@psf.upfronthosting.co.za>
2018-02-20 21:06:56josh.rlinkissue32886 messages
2018-02-20 21:06:56josh.rcreate