Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #32965
| From | Andriy Kornatskyy <andriy.kornatskyy@live.com> |
|---|---|
| Subject | duck typing assert |
| Date | 2012-11-08 20:30 +0300 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3454.1352395870.27098.python-list@python.org> (permalink) |
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
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
duck typing assert Andriy Kornatskyy <andriy.kornatskyy@live.com> - 2012-11-08 20:30 +0300
csiph-web