@@ -83,7 +83,7 @@ while another would handle low-level manipulation of data. The most natural way
8383to separate these two layers is to regroup all interfacing functionality
8484in one file, and all low-level operations in another file. In this case,
8585the interface file needs to import the low-level file. This is done with the
86- `import ` and `from ... import ` statements.
86+ `` import `` and `` from ... import ` ` statements.
8787
8888As soon as you use `import ` statements you use modules. These can be either built-in
8989modules such as `os ` and `sys `, third-party modules you have installed in your
@@ -106,7 +106,7 @@ Aside for some naming restrictions, nothing special is required for a Python fil
106106to be a module, but the import mechanism needs to be understood in order to use
107107this concept properly and avoid some issues.
108108
109- Concretely, the `import modu ` statement will look for the proper file, which is
109+ Concretely, the `` import modu ` ` statement will look for the proper file, which is
110110`modu.py ` in the same directory as the caller if it exists. If it is not
111111found, the Python interpreter will search for `modu.py ` in the "path"
112112recursively and raise an ImportError exception if it is not found.
@@ -120,20 +120,20 @@ Then, the module's variables, functions, and classes will be available to the ca
120120through the module's namespace, a central concept in programming that is
121121particularly helpful and powerful in Python.
122122
123- In many languages, an `include file ` directive is used by the preprocessor to
123+ In many languages, an `` include file ` ` directive is used by the preprocessor to
124124take all code found in the file and 'copy' it into the caller's code. It is
125125different in Python: the included code is isolated in a module namespace, which
126126means that you generally don't have to worry that the included code could have
127127unwanted effects, e.g. override an existing function with the same name.
128128
129129It is possible to simulate the more standard behavior by using a special syntax
130- of the import statement: `from modu import * `. This is generally considered bad
131- practice. **Using `import *` makes code harder to read and makes dependencies less
130+ of the import statement: `` from modu import * ` `. This is generally considered bad
131+ practice. **Using `` import *` ` makes code harder to read and makes dependencies less
132132compartmentalized **.
133133
134- Using `from modu import func ` is a way to pinpoint the function you want to
135- import and put it in the global namespace. While much less harmful than `import
136- * ` because it shows explicitly what is imported in the global namespace, its
134+ Using `` from modu import func ` ` is a way to pinpoint the function you want to
135+ import and put it in the global namespace. While much less harmful than `` import
136+ * `` because it shows explicitly what is imported in the global namespace, its
137137advantage over a simpler `import modu ` is only that it will save some typing.
138138
139139**Very bad **
@@ -166,7 +166,7 @@ Python. Readability means to avoid useless boilerplate text and clutter,
166166therefore some efforts are spent trying to achieve a certain level of brevity.
167167But terseness and obscurity are the limits where brevity should stop. Being
168168able to tell immediately where a class or function comes from, as in the
169- `modu.func ` idiom, greatly improves code readability and understandability in
169+ `` modu.func ` ` idiom, greatly improves code readability and understandability in
170170all but the simplest single file projects.
171171
172172
@@ -383,7 +383,7 @@ Python has two kinds of built-in or user-defined types.
383383
384384Mutable types are those that allow in-place modification
385385of the content. Typical mutables are lists and dictionaries:
386- All lists have mutating methods, like `` append() `` or `` pop() ` `, and
386+ All lists have mutating methods, like :py:meth: ` list. append` or :py:meth: ` list. pop `, and
387387can be modified in place. The same goes for dictionaries.
388388
389389Immutable types provide no method for changing their content.
@@ -464,10 +464,11 @@ should be your preferred method.
464464 foo = ' ' .join([foo, ' ooo' ])
465465
466466 .. note ::
467- You can also use the ``% `` formatting operator to concatenate the
468- pre-determined number of strings besides ``join() `` and ``+ ``. However,
469- according to :pep: `3101 `, the ``% `` operator became deprecated in
470- Python 3.1 and will be replaced by the ``format() `` method in the later versions.
467+ You can also use the :ref: `% <python:string-formatting >` formatting operator
468+ to concatenate a pre-determined number of strings besides :py:meth: `str.join `
469+ and ``+ ``. However, according to :pep: `3101 `, the ``% `` operator became
470+ deprecated in Python 3.1 and will be replaced by the :py:meth: `str.format `
471+ method in the later versions.
471472
472473.. code-block :: python
473474
0 commit comments