New submission from João Henrique Pimentel <joaozi...@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@python
components: Documentation
messages: 393684
nosy: docs@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue44135>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to