Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32965 > unrolled thread

duck typing assert

Started byAndriy Kornatskyy <andriy.kornatskyy@live.com>
First post2012-11-08 20:30 +0300
Last post2012-11-08 20:30 +0300
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  duck typing assert Andriy Kornatskyy <andriy.kornatskyy@live.com> - 2012-11-08 20:30 +0300

#32965 — duck typing assert

FromAndriy Kornatskyy <andriy.kornatskyy@live.com>
Date2012-11-08 20:30 +0300
Subjectduck typing assert
Message-ID<mailman.3454.1352395870.27098.python-list@python.org>
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
 		 	   		  

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web