mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
Merged revisions 82757-82758,82760-82764 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82757 | georg.brandl | 2010-07-10 10:58:37 +0200 (Sa, 10 Jul 2010) | 1 line Fix markup. ........ r82758 | georg.brandl | 2010-07-10 12:23:40 +0200 (Sa, 10 Jul 2010) | 1 line Emphasize role of count for Pascal string. ........ r82760 | georg.brandl | 2010-07-10 12:39:57 +0200 (Sa, 10 Jul 2010) | 1 line #3214: improve description of duck-typing in glossary. ........ r82761 | georg.brandl | 2010-07-10 13:40:13 +0200 (Sa, 10 Jul 2010) | 1 line #1434090: properly append child in expatbuilder doctype handler. ........ r82762 | georg.brandl | 2010-07-10 13:51:06 +0200 (Sa, 10 Jul 2010) | 1 line #8338: fix outdated class name. ........ r82763 | georg.brandl | 2010-07-10 14:01:34 +0200 (Sa, 10 Jul 2010) | 1 line #8456: fix signature of sqlite3.connect(). ........ r82764 | georg.brandl | 2010-07-10 14:20:38 +0200 (Sa, 10 Jul 2010) | 1 line #8564: update docs on integrating doctest/unittest with unittest(2) test discovery. ........
This commit is contained in:
parent
41b986c352
commit
e85e1ae413
5 changed files with 20 additions and 21 deletions
|
|
@ -156,9 +156,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue