Skip to content

Commit 8909c8e

Browse files
committed
Punctuation
1 parent 13bd6b5 commit 8909c8e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Doc/faq/programming.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ them into a list and call :meth:`str.join` at the end::
11431143
chunks.append(s)
11441144
result = ''.join(chunks)
11451145

1146-
(another reasonably efficient idiom is to use :class:`io.StringIO`)
1146+
(Another reasonably efficient idiom is to use :class:`io.StringIO`.)
11471147

11481148
To accumulate many :class:`bytes` objects, the recommended idiom is to extend
11491149
a :class:`bytearray` object using in-place concatenation (the ``+=`` operator)::
@@ -1218,7 +1218,7 @@ list, deleting duplicates as you go::
12181218
last = mylist[i]
12191219

12201220
If all elements of the list may be used as set keys (that is, they are all
1221-
:term:`hashable`) this is often faster ::
1221+
:term:`hashable`) this is often faster::
12221222

12231223
mylist = list(set(mylist))
12241224

@@ -1254,7 +1254,7 @@ difference is that a Python list can contain objects of many different types.
12541254
The ``array`` module also provides methods for creating arrays of fixed types
12551255
with compact representations, but they are slower to index than lists. Also
12561256
note that `NumPy <https://numpy.org/>`_
1257-
and other third party packages define array-like structures with
1257+
and other third-party packages define array-like structures with
12581258
various characteristics as well.
12591259

12601260
To get Lisp-style linked lists, you can emulate *cons cells* using tuples::
@@ -1574,7 +1574,7 @@ call it::
15741574
What is delegation?
15751575
-------------------
15761576

1577-
Delegation is an object oriented technique (also called a design pattern).
1577+
Delegation is an object-oriented technique (also called a design pattern).
15781578
Let's say you have an object ``x`` and want to change the behaviour of just one
15791579
of its methods. You can create a new class that provides a new implementation
15801580
of the method you're interested in changing and delegates all other methods to
@@ -1710,7 +1710,7 @@ How can I overload constructors (or methods) in Python?
17101710
This answer actually applies to all methods, but the question usually comes up
17111711
first in the context of constructors.
17121712

1713-
In C++ you'd write
1713+
In C++ you'd write:
17141714

17151715
.. code-block:: c
17161716
@@ -1731,7 +1731,7 @@ default arguments. For example::
17311731

17321732
This is not entirely equivalent, but close enough in practice.
17331733

1734-
You could also try a variable-length argument list, for example ::
1734+
You could also try a variable-length argument list, for example::
17351735

17361736
def __init__(self, *args):
17371737
...
@@ -2095,7 +2095,7 @@ creation of a .pyc file is automatic if you're importing a module and Python
20952095
has the ability (permissions, free space, and so on) to create a ``__pycache__``
20962096
subdirectory and write the compiled module to that subdirectory.
20972097

2098-
Running Python on a top level script is not considered an import and no
2098+
Running Python on a top-level script is not considered an import and no
20992099
``.pyc`` will be created. For example, if you have a top-level module
21002100
``foo.py`` that imports another module ``xyz.py``, when you run ``foo`` (by
21012101
typing ``python foo.py`` as a shell command), a ``.pyc`` will be created for
@@ -2219,7 +2219,7 @@ changed module, do this::
22192219
importlib.reload(modname)
22202220

22212221
Warning: this technique is not 100% fool-proof. In particular, modules
2222-
containing statements like ::
2222+
containing statements like::
22232223

22242224
from modname import some_objects
22252225

0 commit comments

Comments
 (0)