[docs] [issue37307] isinstance/issubclass doc isn't clear on whether it's an AND or an OR.

Franklin? Lee report at bugs.python.org
Sun Jun 16 07:59:07 EDT 2019


New submission from Franklin? Lee <leewangzhong at gmail.com>:

isinstance:
> If classinfo is not a class (type object), it may be a tuple of type objects, or may recursively contain other such tuples (other sequence types are not accepted).

issubclass:
> classinfo may be a tuple of class objects, in which case every entry in classinfo will be checked.

It is unclear from the docs whether
    issubclass(bool, (int, float))
should return True (because bool is a subclass of int),
or False (because bool is NOT a subclass of float).
(It returns True.)

It's likely also false that every entry will be checked, since presumably the function uses short-circuit logic.

issubclass's doc also doesn't mention the recursive tuple case that isinstance's doc has.

----------
assignee: docs at python
components: Documentation
messages: 345744
nosy: docs at python, leewz
priority: normal
severity: normal
status: open
title: isinstance/issubclass doc isn't clear on whether it's an AND or an OR.
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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


More information about the docs mailing list