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

2019-06-21 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: -Python 3.5, Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

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

2019-06-16 Thread SilentGhost
SilentGhost added the comment: It's the same behaviour as for isinstance, could be enough to add "classinfo is treated as in isinstance call" to avoid duplication. This would also solve short-cutting imprecision. -- ___ Python tracker

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

2019-06-16 Thread Franklin? Lee
Franklin? Lee added the comment: > > It's likely also false that every entry will be checked, since presumably > > the function uses short-circuit logic. > This, however, would be good to verify first. Verified. https://github.com/python/cpython/blob/36dcaab7fde5d2e54cdeff5b705b5adcb27726dd/

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

2019-06-16 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: docstring for issubclass is a bit clear on the behavior issubclass(cls, class_or_tuple, /) Return whether 'cls' is a derived from another class or is the same class. A tuple, as in ``issubclass(x, (A, B, ...))``, may be given as the target

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

2019-06-16 Thread Franklin? Lee
Franklin? Lee added the comment: My mistake. I selected all versions after checking issubclass for 2.7 and several 3.x, but added the isinstance notes later without paying attention to versions. I copied the isinstance text from 3.2 docs. As you said, it's not the current text. --

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

2019-06-16 Thread SilentGhost
SilentGhost added the comment: > It's likely also false that every entry will be checked, since presumably the > function uses short-circuit logic. This, however, would be good to verify first. -- ___ Python tracker

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

2019-06-16 Thread SilentGhost
SilentGhost added the comment: Where are you seeing the text you've quoted for isinstance? You've marked as all versions affected, but for the master docs the text for isinstance is different and is unambiguous re treatment of tuple classinfo. I agree with all your points about issubclass -

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

2019-06-16 Thread Franklin? Lee
New submission from Franklin? Lee : 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 ever