@@ -35,9 +35,9 @@ include:
35
35
36
36
- Multiple and messy circular dependencies: if your classes
37
37
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() `` ,
39
39
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
41
41
have a circular dependency. In this case you will have to resort to
42
42
fragile hacks such as using import statements inside
43
43
methods or functions.
@@ -236,7 +236,7 @@ processes are spawned to respond to external requests that can
236
236
happen at the same time. In this case, holding some state into instantiated
237
237
objects, which means keeping some static information about the world, is prone
238
238
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
240
240
of the object state through one of its methods, the world may have changed, and
241
241
the retained state may be outdated. For example, a request may load an item in
242
242
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.
383
383
384
384
Mutable types are those that allow in-place modification
385
385
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
387
387
can be modified in place. The same goes for dictionaries.
388
388
389
389
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,
418
418
which is mutable, and then glue ('join') the parts together when the
419
419
full string is needed. One thing to notice, however, is that list
420
420
comprehensions are better and faster than constructing a list in a loop
421
- with calls to append().
421
+ with calls to `` append() `` .
422
422
423
423
**Bad **
424
424
@@ -464,10 +464,10 @@ should be your preferred method.
464
464
foo = ' ' .join([foo, ' ooo' ])
465
465
466
466
.. 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.
471
471
472
472
.. code-block :: python
473
473
0 commit comments