Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d95b26b

Browse filesBrowse files
author
kuyan
committed
Use code tags where needed.
1 parent b6f0143 commit d95b26b
Copy full SHA for d95b26b

File tree

Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed

‎docs/writing/structure.rst

Copy file name to clipboardExpand all lines: docs/writing/structure.rst
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ include:
3535

3636
- Multiple and messy circular dependencies: if your classes
3737
Table and Chair in furn.py need to import Carpenter from workers.py
38-
to answer a question such as table.isdoneby(),
38+
to answer a question such as ``table.isdoneby()``,
3939
and if conversely the class Carpenter needs to import Table and Chair,
40-
to answer the question carpenter.whatdo(), then you
40+
to answer the question ``carpenter.whatdo()``, then you
4141
have a circular dependency. In this case you will have to resort to
4242
fragile hacks such as using import statements inside
4343
methods or functions.
@@ -236,7 +236,7 @@ processes are spawned to respond to external requests that can
236236
happen at the same time. In this case, holding some state into instantiated
237237
objects, which means keeping some static information about the world, is prone
238238
to concurrency problems or race-conditions. Sometimes, between the initialization of
239-
the state of an object (usually done with the __init__() method) and the actual use
239+
the state of an object (usually done with the ``__init__()`` method) and the actual use
240240
of the object state through one of its methods, the world may have changed, and
241241
the retained state may be outdated. For example, a request may load an item in
242242
memory and mark it as read by a user. If another request requires the deletion
@@ -383,7 +383,7 @@ Python has two kinds of built-in or user-defined types.
383383

384384
Mutable types are those that allow in-place modification
385385
of 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 ``append()`` or ``pop()``, and
387387
can be modified in place. The same goes for dictionaries.
388388

389389
Immutable types provide no method for changing their content.
@@ -418,7 +418,7 @@ its parts, it is much more efficient to accumulate the parts in a list,
418418
which is mutable, and then glue ('join') the parts together when the
419419
full string is needed. One thing to notice, however, is that list
420420
comprehensions are better and faster than constructing a list in a loop
421-
with calls to append().
421+
with calls to ``append()``.
422422

423423
**Bad**
424424

@@ -464,10 +464,10 @@ 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 ``%`` 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.
471471

472472
.. code-block:: python
473473

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.