[issue20415] Could method "isinstance" take a list as parameter?

Chen ZHANG report at bugs.python.org
Tue Jan 28 10:27:54 CET 2014


New submission from Chen ZHANG:

Since the usage of isinstance could be "isinstance(1, (int, float))", I'm wondering why it doesn't accept "[int, float]", if I do so, it would raise TypeError saying "arg 2 must be a type or tuple of types". What's the difference in effect between a tuple and a list here? (I know a tuple is immutable, but I think it doesn't matter when passing some other types of non-string iterables(yielding strings), am I right?

----------
components: Library (Lib)
messages: 209519
nosy: Chen.ZHANG
priority: normal
severity: normal
status: open
title: Could method "isinstance" take a list as parameter?
type: enhancement

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


More information about the Python-bugs-list mailing list