[Python-ideas] Allow isinstance second argument to be a set of types

Antoine Pitrou solipsis at pitrou.net
Mon Jul 4 19:55:25 CEST 2011


Le lundi 04 juillet 2011 à 10:52 -0700, Gregory P. Smith a écrit :
> note that a fast lookup implies exact type and not subclass making my
> point silly... at which point you're back to iterating so I suspect
> supporting arbitrary iterables is actually how this will be
> implemented regardless.

Indeed. Note that the tuple case should remain fast, and therefore
special-cased (or the general list/tuple case, since the difference in C
is rather small).

Regards

Antoine.





More information about the Python-ideas mailing list