homepage

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 mark.dickinson
Recipients mark.dickinson, rhettinger, serhiy.storchaka, tim.peters, tomerv
Date 2019年08月12日.18:24:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565634274.63.0.926632949281.issue37831@roundup.psfhosted.org>
In-reply-to
Content
> Making True == -1 looks interesting, but it has drawbacks.
Yes, please ignore that part of my post. :-) It shouldn't be considered seriously until a time machine turns up (and probably not even then).
My main worry with the proposed change is accidental breakage from the change in meaning. I've so far failed to find any examples of real-world functions that could/would be broken - the closest I've come is floating-point bit-pattern manipulation functions (constructing a bit-string from a sign, exponent and significand, where it's quite natural to treat the sign both as an "is_negative" boolean and as a 0-or-1 integer). But that case didn't involve a `~sign` at any point, so it doesn't count.
Still, I have a nagging suspicion that such a function will turn up if we make this change.
Having ~True *not* be the same as ~1 feels like a bigger surprise to me than having ~True not be False; it breaks my simple mental model that bools always behave like ints in numeric contexts.
History
Date User Action Args
2019年08月12日 18:24:34mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, serhiy.storchaka, tomerv
2019年08月12日 18:24:34mark.dickinsonsetmessageid: <1565634274.63.0.926632949281.issue37831@roundup.psfhosted.org>
2019年08月12日 18:24:34mark.dickinsonlinkissue37831 messages
2019年08月12日 18:24:34mark.dickinsoncreate

AltStyle によって変換されたページ (->オリジナル) /