[issue16437] issubclass doc improvement

2021-06-17 Thread Irit Katriel


Irit Katriel  added the comment:

@Ken - not quite. This issue is about isinstance containing "(or recursively, 
other such tuples)" which is not there for issubclass.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16437] issubclass doc improvement

2021-06-16 Thread Ken Jin


Ken Jin  added the comment:

@irit, you may be interested in issue44135, there's an open PR there and it 
seems to fix what this issue describes.

--
nosy: +kj

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16437] issubclass doc improvement

2021-06-16 Thread Irit Katriel


Irit Katriel  added the comment:

Whether the recursive nature of the check should be documented or not, it seems 
inconsistent that it's documented for isinstance but not for issubclass.

--
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16437] issubclass doc improvement

2012-11-08 Thread Yongzhi Pan

New submission from Yongzhi Pan:

http://docs.python.org/3/library/functions.html#issubclass

classinfo may be a tuple of class objects.

I suggest make it clear like isinstance, use something like this:

classinfo may be a tuple of class objects and such tuples.

--
assignee: docs@python
components: Documentation
messages: 175158
nosy: docs@python, fossilet
priority: normal
severity: normal
status: open
title: issubclass doc improvement
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16437
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16437] issubclass doc improvement

2012-11-08 Thread Ezio Melotti

Ezio Melotti added the comment:

While this is documented for isinstance, I'm not sure it should be advertised 
too much, as it seems to me an implementation detail and doesn't seem too 
useful in practice.

This is a side-effect of the fact that
  isinstance(x, (A, B, ...))
is equivalent to
  isinstance(x, A) or isinstance(x, B) or ...
and therefore
  isinstance(x, (A, (B, C)))
is equivalent to
  isinstance(x, A) or isinstance(x, (B, C))
which in turn is equivalent to
  isinstance(x, A) or (isinstance(x, B) or isinstance(x, C))

While this behavior seems intentional [0], it doesn't seem to be tested [1].  
FTR this is supported by PyPy too.

[0]: http://hg.python.org/cpython/file/default/Objects/abstract.c#l2494
[1]: http://hg.python.org/cpython/file/default/Lib/test/test_builtin.py#l704

--
nosy: +ezio.melotti
type:  - enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16437
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com