[issue17157] issubclass() should accept iterables in 2nd arg

Franck Michea report at bugs.python.org
Sat Feb 9 14:49:44 CET 2013


Franck Michea added the comment:

I am neutral on this too, it just felt odd and this is why the question raised.

Yesterday I tried to add sequences and iterables (only to issubclass but indeed it would need better testing and all) and came to a problem with sequences. The current implementation authorizes (A, (B, (C, D))) (why?) so issubclass is recursive, but if we add sequences, they could create infinite recursions if seq[0] == seq (it's the case for strings for example, where 'a' is still a sequence and 'a'[0] == 'a').

So I don't know if it's really interesting. Anyone can use tuple() on an iterable to build its tuple value, though the value is built in memory. It basically just felt odd to take only tuples but I don't know.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17157>
_______________________________________


More information about the Python-bugs-list mailing list