Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Side by Side Diff: Doc/faq/design.rst

Issue 18758: Fix internal references in the documentation
Patch Set: Created 6 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Doc/howto/unicode.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ====================== 1 ======================
2 Design and History FAQ 2 Design and History FAQ
3 ====================== 3 ======================
4 4
5 Why does Python use indentation for grouping of statements? 5 Why does Python use indentation for grouping of statements?
6 ----------------------------------------------------------- 6 -----------------------------------------------------------
7 7
8 Guido van Rossum believes that using indentation for grouping is extremely 8 Guido van Rossum believes that using indentation for grouping is extremely
9 elegant and contributes a lot to the clarity of the average Python program. 9 elegant and contributes a lot to the clarity of the average Python program.
10 Most people learn to love this feature after a while. 10 Most people learn to love this feature after a while.
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 627
628 An interface specification for a module as provided by languages such as C++ and 628 An interface specification for a module as provided by languages such as C++ and
629 Java describes the prototypes for the methods and functions of the module. Many 629 Java describes the prototypes for the methods and functions of the module. Many
630 feel that compile-time enforcement of interface specifications helps in the 630 feel that compile-time enforcement of interface specifications helps in the
631 construction of large programs. 631 construction of large programs.
632 632
633 Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base Classes 633 Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base Classes
634 (ABCs). You can then use :func:`isinstance` and :func:`issubclass` to check 634 (ABCs). You can then use :func:`isinstance` and :func:`issubclass` to check
635 whether an instance or a class implements a particular ABC. The 635 whether an instance or a class implements a particular ABC. The
636 :mod:`collections.abc` module defines a set of useful ABCs such as 636 :mod:`collections.abc` module defines a set of useful ABCs such as
637 :class:`Iterable`, :class:`Container`, and :class:`MutableMapping`. 637 :class:`~collections.abc.Iterable`, :class:`~collections.abc.Container`, and
638 :class:`~collections.abc.MutableMapping`.
638 639
639 For Python, many of the advantages of interface specifications can be obtained 640 For Python, many of the advantages of interface specifications can be obtained
640 by an appropriate test discipline for components. There is also a tool, 641 by an appropriate test discipline for components. There is also a tool,
641 PyChecker, which can be used to find problems due to subclassing. 642 PyChecker, which can be used to find problems due to subclassing.
642 643
643 A good test suite for a module can both provide a regression test and serve as a 644 A good test suite for a module can both provide a regression test and serve as a
644 module interface specification and a set of examples. Many Python modules can 645 module interface specification and a set of examples. Many Python modules can
645 be run as a script to provide a simple "self test." Even modules which use 646 be run as a script to provide a simple "self test." Even modules which use
646 complex external interfaces can often be tested in isolation using trivial 647 complex external interfaces can often be tested in isolation using trivial
647 "stub" emulations of the external interface. The :mod:`doctest` and 648 "stub" emulations of the external interface. The :mod:`doctest` and
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 "fee", 873 "fee",
873 "fie" 874 "fie"
874 "foo", 875 "foo",
875 "fum" 876 "fum"
876 ] 877 ]
877 878
878 This list looks like it has four elements, but it actually contains three: 879 This list looks like it has four elements, but it actually contains three:
879 "fee", "fiefoo" and "fum". Always adding the comma avoids this source of error. 880 "fee", "fiefoo" and "fum". Always adding the comma avoids this source of error.
880 881
881 Allowing the trailing comma may also make programmatic code generation easier. 882 Allowing the trailing comma may also make programmatic code generation easier.
OLDNEW
« no previous file with comments | « no previous file | Doc/howto/unicode.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+