Steven D'Aprano added the comment:
Closing. If anyone thinks the docs aren't clear enough, and has an alternate
version they would like to suggest, you can re-open it.
--
resolution: - rejected
status: open - closed
___
Python tracker
Terry J. Reedy added the comment:
I agree that the tuple explanation if ok. But Return whether an object is an
instance of a class or of a subclass thereof. (3.5) seems wrong. I believe
'subclass' should be 'superclass'.
class C: pass
class Csub(C): pass
isinstance(C(), Csub)
False
New submission from Luc Saffre:
The docstring of built-in function 'isinstance' should explain that if the
classinfo is a tuple, the object must be instance of *any* (not *all*) of the
class objects.
--
assignee: docs@python
components: Documentation
messages: 245841
nosy: Luc Saffre,
Steven D'Aprano added the comment:
It already does:
The form using a tuple, isinstance(x, (A, B, ...)), is a shortcut
for isinstance(x, A) or isinstance(x, B) or ... (etc.).
If it were all, it would use and, not or.
I don't think any change is needed. Do you have a suggestion for new wording?
Terry J. Reedy added the comment:
Right. Close this unless something else is offered.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24515
___
Steven D'Aprano added the comment:
On Fri, Jun 26, 2015 at 09:20:18PM +, Terry J. Reedy wrote:
I agree that the tuple explanation if ok. But Return whether an
object is an instance of a class or of a subclass thereof. (3.5)
seems wrong. I believe 'subclass' should be 'superclass'.