summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-07-10 10:39:57 (GMT)
committerGeorg Brandl <georg@python.org>2010-07-10 10:39:57 (GMT)
commit73b1c7ba7da33ec3d6d7f1ff709210e8be7218ac (patch)
treeecbe66b8a11aad95cc137ae49d84739d949e37f0 /Doc
parent0310a83e7f2cb7cdb94d5a1a737681119783c834 (diff)
downloadcpython-73b1c7ba7da33ec3d6d7f1ff709210e8be7218ac.zip
cpython-73b1c7ba7da33ec3d6d7f1ff709210e8be7218ac.tar.gz
cpython-73b1c7ba7da33ec3d6d7f1ff709210e8be7218ac.tar.bz2
#3214: improve description of duck-typing in glossary.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/glossary.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index acd3009..0fe005d 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -154,9 +154,9 @@ Glossary
object.
duck-typing
- A pythonic programming style which determines an object's type by inspection
- of its method or attribute signature rather than by explicit relationship
- to some type object ("If it looks like a duck and quacks like a duck, it
+ A programming style which does not look at an object's type to determine
+ if it has the right interface; instead, the method or attribute is simply
+ called or used ("If it looks like a duck and quacks like a duck, it
must be a duck.") By emphasizing interfaces rather than specific types,
well-designed code improves its flexibility by allowing polymorphic
substitution. Duck-typing avoids tests using :func:`type` or