Skip to content

Commit 9287a86

Browse files
committed
Update collections.rst
1 parent 3bd24f2 commit 9287a86

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

collections.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The ones which we will talk about are:
1313
- ``namedtuple``
1414
- ``enum.Enum`` (outside of the module; Python 3.4+)
1515

16-
1.\ ``defaultdict``
16+
``defaultdict``
1717
^^^^^^^^^^^^^^^^^^^
1818

1919
I personally use defaultdict quite a bit. Unlike ``dict``, with
@@ -82,7 +82,7 @@ sample code:
8282
print(json.dumps(some_dict))
8383
# Output: {"colours": {"favourite": "yellow"}}
8484
85-
2.\ ``counter``
85+
``counter``
8686
^^^^^^^^^^^^^^^
8787

8888
Counter allows us to count the occurrences of a particular item. For
@@ -119,7 +119,7 @@ We can also count the most common lines in a file using it. For example:
119119
line_count = Counter(f)
120120
print(line_count)
121121
122-
3.\ ``deque``
122+
``deque``
123123
^^^^^^^^^^^^^
124124

125125
``deque`` provides you with a double ended queue which means that you
@@ -196,7 +196,7 @@ new values:
196196
This was just a quick drive through the ``collections`` module. Make
197197
sure you read the official documentation after reading this.
198198

199-
4.\ ``namedtuple``
199+
``namedtuple``
200200
^^^^^^^^^^^^^^^^^^
201201

202202
You might already be acquainted with tuples. A tuple is a lightweight
@@ -282,7 +282,7 @@ Like this:
282282
print(perry._asdict())
283283
# Output: OrderedDict([('name', 'Perry'), ('age', 31), ...
284284
285-
5.\ ``enum.Enum`` (Python 3.4+)
285+
``enum.Enum`` (Python 3.4+)
286286
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
287287

288288
Another useful collection is the enum object. It is available in the ``enum``

0 commit comments

Comments
 (0)