[New-bugs-announce] [issue43453] docs: runtime_checkable example refers to changed behavior in 3.10

Henry Schreiner report at bugs.python.org
Tue Mar 9 16:16:26 EST 2021


New submission from Henry Schreiner <henryschreineriii at gmail.com>:

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.

----------
assignee: docs at python
components: Documentation
messages: 388387
nosy: Henry Schreiner, docs at python
priority: normal
severity: normal
status: open
title: docs: runtime_checkable example refers to changed behavior in 3.10
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43453>
_______________________________________


More information about the New-bugs-announce mailing list