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 gvanrossum
Recipients gvanrossum, josh.r, serhiy.storchaka, steven.daprano, xtreak
Date 2019-01-11.16:07:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
I agree.

On Thu, Jan 10, 2019 at 11:24 PM Serhiy Storchaka <>

> Serhiy Storchaka <> added the comment:
> This is a common mistake. Even the default implementation of object.__ne__
> had a bug, fixed only 4 years ago in issue21408. There were several errors
> in stdlib. I am sure there is a lot of occurrences of this errors in a
> third party code.
> So I like this idea. This can help to fix hidden errors in existing code.
> But I share also Josh's concerns.
> There is related common mistake. In C code, the result of
> PyObject_IsTrue() often is treated as just a boolean, without checking for
> errors. Fortunately, in the current CPython code it is handled properly,
> but I am sure this error still is occurred in third-party extensions.
> When these two errors (using NotImplemented in the boolean context and
> ignoring the error in PyObject_IsTrue() in the C code) meet, this can lead
> to manifestation of more weird bugs than treating NotImplemented as true:
> from a crash in debug build to raising an exception in the following
> unrelated code.
> I suggest to start emitting a DeprecationWarning or a FutureWarning in
> NotImplemented.__bool__.
> ----------
> nosy: +gvanrossum, serhiy.storchaka
> _______________________________________
> Python tracker <>
> <>
> _______________________________________
--Guido (mobile)
Date User Action Args
2019-01-11 16:07:44gvanrossumsetrecipients: + gvanrossum, steven.daprano, serhiy.storchaka, josh.r, xtreak
2019-01-11 16:07:42gvanrossumlinkissue35712 messages
2019-01-11 16:07:42gvanrossumcreate