Skip to content

Commit b00479d

Browse files
eamanurhettinger
authored andcommitted
bpo-36377: Specify that range() can not be compared (pythonGH-12468)
1 parent 9139f92 commit b00479d

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

Doc/tutorial/datastructures.rst

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -678,18 +678,17 @@ intended.
678678

679679
Comparing Sequences and Other Types
680680
===================================
681-
682-
Sequence objects may be compared to other objects with the same sequence type.
683-
The comparison uses *lexicographical* ordering: first the first two items are
684-
compared, and if they differ this determines the outcome of the comparison; if
685-
they are equal, the next two items are compared, and so on, until either
686-
sequence is exhausted. If two items to be compared are themselves sequences of
687-
the same type, the lexicographical comparison is carried out recursively. If
688-
all items of two sequences compare equal, the sequences are considered equal.
689-
If one sequence is an initial sub-sequence of the other, the shorter sequence is
690-
the smaller (lesser) one. Lexicographical ordering for strings uses the Unicode
691-
code point number to order individual characters. Some examples of comparisons
692-
between sequences of the same type::
681+
Sequence objects typically may be compared to other objects with the same sequence
682+
type. The comparison uses *lexicographical* ordering: first the first two
683+
items are compared, and if they differ this determines the outcome of the
684+
comparison; if they are equal, the next two items are compared, and so on, until
685+
either sequence is exhausted. If two items to be compared are themselves
686+
sequences of the same type, the lexicographical comparison is carried out
687+
recursively. If all items of two sequences compare equal, the sequences are
688+
considered equal. If one sequence is an initial sub-sequence of the other, the
689+
shorter sequence is the smaller (lesser) one. Lexicographical ordering for
690+
strings uses the Unicode code point number to order individual characters.
691+
Some examples of comparisons between sequences of the same type::
693692

694693
(1, 2, 3) < (1, 2, 4)
695694
[1, 2, 3] < [1, 2, 4]

0 commit comments

Comments
 (0)