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 steven.daprano
Recipients docs@python, steven.daprano
Date 2021-08-24.03:33:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629776000.21.0.00803055274817.issue44989@roundup.psfhosted.org>
In-reply-to
Content
Truth testing states that "Any object can be tested for truth value" but from 3.9 onwards, doing so with NotImplemented is deprecated and will be made a TypeError.

https://docs.python.org/3/library/stdtypes.html#truth-value-testing

It is also not true for third-party objects such as numpy arrays (which raise ValueError) and pandas dataframes.

I think that truth testing should have been considered a fundamental operation that (in the absence of bugs) always succeeds, but #35712 says different. Not that I'm bitter *wink*

In any case, at the very least the exception for NotImplemented should be documented.
History
Date User Action Args
2021-08-24 03:33:20steven.dapranosetrecipients: + steven.daprano, docs@python
2021-08-24 03:33:20steven.dapranosetmessageid: <1629776000.21.0.00803055274817.issue44989@roundup.psfhosted.org>
2021-08-24 03:33:20steven.dapranolinkissue44989 messages
2021-08-24 03:33:20steven.dapranocreate