Python is DOOMED! Again!

Steven D'Aprano steve+comp.lang.python at
Thu Jan 22 15:57:45 CET 2015

Chris Angelico wrote:

> Hold on a moment, how often do you really do this kind of thing with
> "might be one of them or a sequence"? 

isinstance(obj, one_class_or_tuple_of_classes)
issubclass(cls, one_class_or_tuple_of_classes)
template % one_string_or_tuple_of_strings  # or a dict :-)

I'm not suggesting that the specific example is a good one, but the
principle is sound.


More information about the Python-list mailing list