Skip to content

Commit 6b13ec9

Browse files
Minor syntax fixes to collections text.
Syntax fixes and I also fixed the link to `enumerated type` on WIkipedia.
1 parent 78e04c4 commit 6b13ec9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

collections.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ You can pop values from both sides of the deque:
173173
# Output: deque([1, 2, 3])
174174
175175
We can also limit the amount of items a deque can hold. By doing this
176-
when we achieve the maximum limit of out deque it will simply pop out
176+
when we achieve the maximum limit of our deque it will simply pop out
177177
the items from the opposite end. It is better to explain it using an
178178
example so here you go:
179179

@@ -231,15 +231,15 @@ immutable.
231231
print(perry.name)
232232
# Output: 'perry'
233233
234-
As you can see that now we can access members of a tuple just by their
234+
You can now see that we can access members of a tuple just by their
235235
name using a ``.``. Let's dissect it a little more. A named tuple has two
236236
required arguments. They are the tuple name and the tuple field\_names.
237237
In the above example our tuple name was 'Animal' and the tuple
238238
field\_names were 'name', 'age' and 'cat'. Namedtuple makes your tuples
239239
**self-document**. You can easily understand what is going on by having
240240
a quick glance at your code. And as you are not bound to use integer
241241
indexes to access members of a tuple, it makes it more easy to maintain
242-
your code. Moreover, as **``namedtuple`` instances do not have
242+
your code. Moreover, as **`namedtuple` instances do not have
243243
per-instance dictionaries**, they are lightweight and require no more
244244
memory than regular tuples. This makes them faster than dictionaries.
245245
However, do remember that as with tuples, **attributes in namedtuples
@@ -287,7 +287,7 @@ Like this:
287287

288288
Another useful collection is the enum object. It is available in the ``enum``
289289
module, in Python 3.4 and up (also available as a backport in PyPI named ``enum34``.)
290-
Enums (`enumerated type <https://en.wikipedia.org/wiki/Enumerated_type>`) are
290+
Enums (`enumerated type <https://en.wikipedia.org/wiki/Enumerated_type>`_) are
291291
basically a way to organize various things.
292292

293293
Let’s consider the Animal namedtuple from the last example. It had a ``type``

0 commit comments

Comments
 (0)