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.

classification
Title: docs: runtime_checkable example refers to changed behavior in 3.10
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Henry Schreiner, andrei.avk, docs@python, gvanrossum, miss-islington
Priority: normal Keywords: patch

Created on 2021-03-09 21:16 by Henry Schreiner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27013 merged andrei.avk, 2021-07-04 13:40
PR 27036 merged miss-islington, 2021-07-05 16:45
Messages (3)
msg388387 - (view) Author: Henry Schreiner (Henry Schreiner) * Date: 2021-03-09 21:16
The documentation here: https://docs.python.org/3/library/typing.html#typing.runtime_checkable refers to "For example, builtins.complex implements __float__(), therefore it passes an issubclass() check against SupportsFloat. However, the complex.__float__ method exists only to raise a TypeError with a more informative message.".

However, that's not true in Python 3.10 anymore, those methods were thankfully removed. See https://docs.python.org/3.10/whatsnew/3.10.html#removed or https://bugs.python.org/issue41974 for the removal.

This documentation should either say "before Python 3.10, ...", or pick some other example that still is valid. Happy to make the change if I know what direction this should go.
msg397004 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2021-07-05 16:23
New changeset 17f94e28882e1e2b331ace93f42e8615383dee59 by andrei kulakov in branch 'main':
bpo-43453: Update and re-add example to typing runtime_checkable (#27013)
https://github.com/python/cpython/commit/17f94e28882e1e2b331ace93f42e8615383dee59
msg397021 - (view) Author: miss-islington (miss-islington) Date: 2021-07-05 20:46
New changeset 846cc4d28025ac4319069ec3c6db9526c75efd40 by Miss Islington (bot) in branch '3.10':
bpo-43453: Update and re-add example to typing runtime_checkable (GH-27013)
https://github.com/python/cpython/commit/846cc4d28025ac4319069ec3c6db9526c75efd40
History
Date User Action Args
2022-04-11 14:59:42adminsetgithub: 87619
2021-07-05 20:47:15gvanrossumsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-07-05 20:46:06miss-islingtonsetmessages: + msg397021
2021-07-05 16:45:43miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request25596
2021-07-05 16:23:49gvanrossumsetnosy: + gvanrossum
messages: + msg397004
2021-07-04 13:40:28andrei.avksetkeywords: + patch
nosy: + andrei.avk

pull_requests: + pull_request25573
stage: patch review
2021-03-09 21:16:26Henry Schreinercreate