Skip to content

Commit ec68594

Browse files
Apply suggestions from code review
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
1 parent 0aa0256 commit ec68594

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Doc/reference/datamodel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3250,7 +3250,7 @@ through the object's keys; for sequences, it should iterate through the values.
32503250

32513251
- **sequences**, where *subscript* (also called
32523252
*index*) should be an integer or a :class:`slice` object.
3253-
See :ref:`sequence documentation <datamodel-sequences>` for the expected
3253+
See the :ref:`sequence documentation <datamodel-sequences>` for the expected
32543254
behavior, including handling :class:`slice` objects and negative indices.
32553255
- **mappings**, where *subscript* is also called the *key*.
32563256
See :ref:`mapping documentation <datamodel-mappings>` for the expected

Doc/reference/expressions.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,11 +1044,11 @@ colon::
10441044
>>> number_names[1:3]
10451045
['one', 'two']
10461046
>>> number_names[1:]
1047-
['one', two', 'three', 'four', 'five']
1047+
['one', 'two', 'three', 'four', 'five']
10481048
>>> number_names[:3]
10491049
['zero', 'one', 'two']
10501050
>>> number_names[:]
1051-
['zero', 'one', 'two']
1051+
['zero', 'one', 'two', 'three', 'four', 'five']
10521052
>>> number_names[::2]
10531053
['zero', 'two', 'four']
10541054

@@ -1101,13 +1101,13 @@ In this case, the interpreter unpacks the result into a tuple, and passes
11011101
this tuple to :meth:`~object.__getitem__` or :meth:`~object.__class_getitem__`::
11021102

11031103
>>> demo[*range(10)]
1104-
subscripted with (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
1104+
subscripted with: (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
11051105

11061106
Starred expressions may be combined with comma-separated expressions
1107-
and slices:::
1107+
and slices::
11081108

11091109
>>> demo['a', 'b', *range(3), 'c']
1110-
subscripted with: ('a', 'b', 0, 1, 2, 'c')
1110+
subscripted with: ('a', 'b', 0, 1, 2, 'c')
11111111

11121112

11131113
Formal subscription grammar
@@ -1123,7 +1123,7 @@ Formal subscription grammar
11231123
proper_slice: [`expression`] ":" [`expression`] [ ":" [`expression`] ]
11241124

11251125
There is a semantic difference between the alternatives for *subscript*.
1126-
If *subscript* contains ony one unstarred *slice* without a trailing comma,
1126+
If *subscript* contains only one unstarred *slice* without a trailing comma,
11271127
it will evaluate to the value of that *slice*.
11281128
Otherwise, *subscript* will evaluate to a :class:`tuple` containing
11291129
the items of *tuple_slices*.

0 commit comments

Comments
 (0)