On Mon, 01 Sep 2008 11:45:36 +0200, Luca wrote: >> But not so easy to fool a type check: >> >>>>> type(x) == new.function >> False >> >> Of course that's not bullet-proof either. I leave it as an exercise to >> discover how you might break that piece of code. >> >> > Ok, so... > > What is the best way to do this? The "most pythonic"?
The "most pythonic" might be not checking at all but simply *call* the object and deal with possible failures. What's your use case? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list