On 10/11/06, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Now the real question : what if the object is not an instance of any of > the types, but still support the expected interface ?
Perhaps: try: for attribute in ['foo', 'bar', '__baz__']: getattr(mystery_object, '__%s__' % attribute) except AttributeError: # Do sumthin bout it Is it wrong to 're-raise' an exception with application-specific details within an except clause? -- Theerasak -- http://mail.python.org/mailman/listinfo/python-list