Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #32965 > unrolled thread
| Started by | Andriy Kornatskyy <andriy.kornatskyy@live.com> |
|---|---|
| First post | 2012-11-08 20:30 +0300 |
| Last post | 2012-11-08 20:30 +0300 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
duck typing assert Andriy Kornatskyy <andriy.kornatskyy@live.com> - 2012-11-08 20:30 +0300
| From | Andriy Kornatskyy <andriy.kornatskyy@live.com> |
|---|---|
| Date | 2012-11-08 20:30 +0300 |
| Subject | duck 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
Back to top | Article view | comp.lang.python
csiph-web