John Reese wrote: > I now do: > if isinstance(x, list): [snip] > > I'm not saying I do it a lot, but sometimes it's useful to write > methods with interfaces like, well, isinstance's, whose second argument > can be a single type object or a sequence of class objects.
Personally, I'd just write these functions with a *args instead, e.g.: def my_isinstance(obj, *types): return isinstance(obj, types) Sure, it's not an option if you need multiple type lists, but how often does that happen? STeVe -- http://mail.python.org/mailman/listinfo/python-list