Bruno Desthuilliers schrieb: > [EMAIL PROTECTED] a écrit : >> Hi, >> >> Is it possible to find out if an object is of a certain type or of a >> type derived from this type? >> > You have the answer, thanks to Diez and Christian. Now unless you have a > *very* compelling reason to check the type of an object, *just forget > about it*. 9 times out of 10, this is fighting against the language's > type system (hint: google for "duck typing"). So I have to give up the concept that argument types are part of the interface or signature? Honestly, I don't like that. Granted; not having strict type checking makes for great flexibility but the price is you either write typchecking code or let the error propagate into the function or method. I hope type annotations in py3k will allow for something like constraints in C# where you can tell the caller right away she's doing something wrong.
greetings Paul BTW: are type annotations to be backported to 2.x? -- http://mail.python.org/mailman/listinfo/python-list