]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
typing docs: Clarify Protocol / runtime_checkable docs (#132606)
authorJelle Zijlstra <jelle.zijlstra@gmail.com>
Wed, 16 Apr 2025 17:44:17 +0000 (10:44 -0700)
committerGitHub <noreply@github.com>
Wed, 16 Apr 2025 17:44:17 +0000 (17:44 +0000)
commit14efcadfd4cbdab0ff204cad9d89871cc64e6cfb
treebd872c92714e17805180f4cf314b3bb4eaf3ffd4
parent2925462411c3dd4a597d8a0919c65fa02697db76
typing docs: Clarify Protocol / runtime_checkable docs (#132606)

- Explicitly say that isinstance/issubclass do not work on non-runtime checkable
  protocols.
- Move the sentence "This raises TypeError when applied to a non-protocol class". It
  took me quite some time to decide what "this" was here: it refers to applying the
  decorator, not to an isinstance() call.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Doc/library/typing.rst