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 eric.smith
Recipients eric.smith, tfish2
Date 2022-03-10.10:42:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The documentation doesn't say that assert statements are the only place AssertionError is raised, so I don't think it's incorrect.

> From this, one can infer the guarantee "the -O flag will suppress AssertionError exceptions from being raised".

I don't think that follows from what the documentation says. It's only talking about assert statements.

This is equivalent to StopIteration: it is commonly raised by exhausting iterators, but it can be raised elsewhere. Or KeyError: the docs say "Raised when a mapping (dictionary) key is not found in the set of existing keys", but I've raised them in my own code.

> An assert[{add reference to `assert` definition}] statement fails, or a unit testing related assert{...}() callable detects an assertion violation.

I think that's also misleading, and not an improvement. Why focus just on testing? It can certainly be raised elsewhere.

If anything, I think maybe add a note at the top of the list of Concrete Exceptions saying these are common ways these exceptions are raised, but they can be raised elsewhere. But I'm -0 on such a change.
Date User Action Args
2022-03-10 10:42:05eric.smithsetrecipients: + eric.smith, tfish2
2022-03-10 10:42:05eric.smithsetmessageid: <>
2022-03-10 10:42:05eric.smithlinkissue46972 messages
2022-03-10 10:42:05eric.smithcreate