Python 3 isinstance

Carl Banks pavlovevidence at gmail.com
Wed Jan 14 23:43:40 CET 2009


On Jan 14, 4:14 pm, "Lambert, David W (S&T)" <Lamber... at Corning.com>
wrote:
> Please, why isn't a set permitted as the second argument to isinstance?

The Python development team might be open to adding it if you were to
submit a patch.  The use case is fairly obvious.  I doubt any of them
would respond to a wishlist request, though.

As a workaround, you can just cast the set to a tuple like this:

isinstance(x,tuple(s))


Carl Banks



More information about the Python-list mailing list