duck typing assert

Andriy Kornatskyy andriy.kornatskyy at
Thu Nov 8 18:30:02 CET 2012

People who come from strongly typed languages that offer interfaces often are confused by lack of one in Python. Python, being dynamic typing programming language, follows duck typing principal. It can as simple as this:

assert looks(Foo).like(IFoo)

The post below shows how programmer can assert duck typing between two Python classes:

Comments or suggestions are welcome.


Andriy Kornatskyy

More information about the Python-list mailing list