duck typing assert

Andriy Kornatskyy andriy.kornatskyy at live.com
Thu Nov 8 12:30:02 EST 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:

mindref.blogspot.com/2012/11/python-duck-typing-assert.html

Comments or suggestions are welcome.

Thanks.

Andriy Kornatskyy
 		 	   		  


More information about the Python-list mailing list