Thursday, April 2, 2009

Types are to Python as animals are to ___

I'm thinking clouds in the sky in the above one. Which is why the following StackOverflow thread is infinitely ironic. What it really comes down to is, the type of an object in Python may or may not correspond to the method interface it implements.

When in Rome, do as the Romans. Thus, when in Python you should only care about method interfaces. If you need to know whether something is a duck and the quack isn't enough, you are doing something wrong (or expecting too much from the poor duck)!

No comments:

Post a Comment