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

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jul 5 03:07:26 CEST 2011


Gregory P. Smith wrote:

> A set lookup should be faster than iteration for anything over ~3 types. 

But you can't use a set lookup. You have to do
a subclass test against all the members of the
set, so the fact that it's a set rather than
some other iterable doesn't help you.

-- 
Greg



More information about the Python-ideas mailing list