[New-bugs-announce] [issue44135] issubclass documentation doesn't explain tuple semantic

João Henrique Pimentel report at bugs.python.org
Fri May 14 14:24:27 EDT 2021


New submission from João Henrique Pimentel <joaozinho at gmail.com>:

The second parameter (classinfo) of the issubclass built-in function can be a Tuple and, starting from 3.10, it can be a Union Type as well.

The documentation states that in these cases "every entry in classinfo will be checked", but it doesn't explain if the check is AND (all) or OR (any). In contrast, the documentation of isinstance is clear: "return True if object is an instance of *any* of the types".


Here's a possible rewriting that reduces the odds of incorrect interpretations, based on the text of isinstance:
ORIGINAL: "in which case every entry in classinfo will be checked"
PROPOSAL: "in which case return True if class is a subclass of any entry in classinfo"

----------
assignee: docs at python
components: Documentation
messages: 393684
nosy: docs at python, joaozinho
priority: normal
severity: normal
status: open
title: issubclass documentation doesn't explain tuple semantic
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list