Python 3 isinstance

Terry Reedy tjreedy at
Thu Jan 15 06:40:12 CET 2009

Lambert, David W (S&T) wrote:
> Overly terse.  I do mean that this is illegal:
> isinstance(s, {str, bytes})
> tuples have order, immutability, and the possibility of repeat items.
> A set is most reasonable in a mathematical sense.

I agree.  However, isinstance predates set.  Hence the status quo.

More information about the Python-list mailing list