mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Manually patched a few things that didn't get merged in, but should.
This commit is contained in:
parent
af554a0e17
commit
da27fd2673
16 changed files with 73 additions and 31 deletions
|
@ -987,7 +987,7 @@ Comparison of objects of the same type depends on the type:
|
|||
|
||||
* Strings are compared lexicographically using the numeric equivalents (the
|
||||
result of the built-in function :func:`ord`) of their characters. Unicode and
|
||||
8-bit strings are fully interoperable in this behavior.
|
||||
8-bit strings are fully interoperable in this behavior. [#]_
|
||||
|
||||
* Tuples and lists are compared lexicographically using comparison of
|
||||
corresponding elements. This means that to compare equal, each element must
|
||||
|
@ -1272,6 +1272,12 @@ groups from right to left).
|
|||
cases, Python returns the latter result, in order to preserve that
|
||||
``divmod(x,y)[0] * y + x % y`` be very close to ``x``.
|
||||
|
||||
.. [#] While comparisons between unicode strings make sense at the byte
|
||||
level, they may be counter-intuitive to users. For example, the
|
||||
strings ``u"\u00C7"`` and ``u"\u0327\u0043"`` compare differently,
|
||||
even though they both represent the same unicode character (LATIN
|
||||
CAPTITAL LETTER C WITH CEDILLA).
|
||||
|
||||
.. [#] The implementation computes this efficiently, without constructing lists or
|
||||
sorting.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue