New submission from Franklin? Lee <leewangzh...@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@python
components: Documentation
messages: 345744
nosy: docs@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue37307>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to