]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-46480: rephrase typing.assert_type docs (GH-32069)
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>
Thu, 24 Mar 2022 02:15:06 +0000 (19:15 -0700)
committerGitHub <noreply@github.com>
Thu, 24 Mar 2022 02:15:06 +0000 (19:15 -0700)
commit3354245daf89ca2c760c2c3e5b69a571f25073ed
tree6e9956b887e02dc2e8905c501c6660a687de61d3
parent366c54633e7d6a4ce94c3f0f80c2abf82a869e15
bpo-46480: rephrase typing.assert_type docs (GH-32069)

The goal here is to reduce potential confusion between
`assert_type(val, type)` and `assert isinstance(val, typ)`.

The former is meant to ask a type checker to confirm a fact, the latter
is meant to tell a type checker a fact. The behaviour of the latter more
closely resembles what I'd expect from the prior phrasing of
"assert [something] to the type checker".
Doc/library/typing.rst
Lib/typing.py