Oct. 5, 2001
8:24 a.m.
Barry A. Warsaw writes:
And what would it return? It needs to return a true value on success, but maybe instead of returning 1, it might be more useful to return the type argument that matched, e.g.:
Ugh! If that's what you want, make it explicit in the code: for t in ListType, TupleType, ...: if isinstance(obj, t): break else: raise Exception('no match!') -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation