[issue3214] Suggest change to glossary explanation: "Duck Typing"
Georg Brandl
report at bugs.python.org
Tue Jul 1 22:35:49 CEST 2008
Georg Brandl <georg at python.org> added the comment:
Paddy: IMO hasattr() is the "if it quacks like a duck" part of
duck-typing. It e.g. allows testing "hasattr(x, 'write')" to see if it's
a writable file-like object, and doing something else otherwise.
Benjamin: ABCs are not duck-typing since they involve isinstance() anyway.
----------
resolution: -> works for me
status: open -> pending
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3214>
_______________________________________
More information about the Python-bugs-list
mailing list