Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(159295)

#12067: Doc: remove errors about mixed-type comparisons.

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 2 months ago by tjreedy
Modified:
2 years, 10 months ago
Reviewers:
ezio.melotti, mhoy09, vadmium+py, blckknght, andreas.r.maier, jimjjewett, storchaka+cpython
CC:
rhettinger, terry.reedy, mark.dickinson, Benjamin Peterson, ezio.melotti, stevenjd, r.david.murray, cvrebert, cjerdonek, docs_python.org, devnull_psf.upfronthosting.co.za, berkerpeksag, Martin Panter, mikehoy, andymaier, csabella
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 2

Patch Set 3 #

Patch Set 4 #

Patch Set 5 #

Patch Set 6 #

Total comments: 12

Patch Set 7 #

Total comments: 21

Patch Set 8 #

Total comments: 12

Patch Set 9 #

Patch Set 10 #

Total comments: 28

Patch Set 11 #

Total comments: 4

Patch Set 12 #

Patch Set 13 #

Patch Set 14 #

Total comments: 7

Patch Set 15 #

Patch Set 16 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/reference/expressions.rst View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 24
ezio.melotti
http://bugs.python.org/review/12067/diff/6175/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): http://bugs.python.org/review/12067/diff/6175/Doc/reference/expressions.rst#newcode1048 Doc/reference/expressions.rst:1048: specific :meth:`__eq__()` and :meth:`__ne__()`. With ``<``, ``>``, These should ...
6 years, 9 months ago #1
mikehoy
http://bugs.python.org/review/12067/diff/6175/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): http://bugs.python.org/review/12067/diff/6175/Doc/reference/expressions.rst#newcode1048 Doc/reference/expressions.rst:1048: specific :meth:`__eq__()` and :meth:`__ne__()`. With ``<``, ``>``, On 2013/02/23 ...
6 years, 9 months ago #2
mikehoy
On 2013/02/23 07:51:56, ezio.melotti wrote: > http://bugs.python.org/review/12067/diff/6175/Doc/reference/expressions.rst > File Doc/reference/expressions.rst (right): > > http://bugs.python.org/review/12067/diff/6175/Doc/reference/expressions.rst#newcode1048 > ...
6 years, 9 months ago #3
mikehoy
6 years, 9 months ago #4
Martin Panter
Some comments on the doc changes https://bugs.python.org/review/12067/diff/12409/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): https://bugs.python.org/review/12067/diff/12409/Doc/reference/expressions.rst#newcode1087 Doc/reference/expressions.rst:1087: The behavior of ...
5 years, 3 months ago #5
Steven.Barker
I think the patch is great, with the exception of one line (which I have ...
5 years, 3 months ago #6
andymaier
http://bugs.python.org/review/12067/diff/12409/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): http://bugs.python.org/review/12067/diff/12409/Doc/reference/expressions.rst#newcode1087 Doc/reference/expressions.rst:1087: The behavior of the default equality comparison that instances ...
5 years, 2 months ago #7
andymaier
http://bugs.python.org/review/12067/diff/13054/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): http://bugs.python.org/review/12067/diff/13054/Doc/reference/expressions.rst#newcode1093 Doc/reference/expressions.rst:1093: otherwise, :exc:`TypeError` is raised: After thinking again about Martin ...
5 years, 2 months ago #8
andymaier
http://bugs.python.org/review/12067/diff/13054/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): http://bugs.python.org/review/12067/diff/13054/Doc/reference/expressions.rst#newcode1174 Doc/reference/expressions.rst:1174: Should we move the remainder of this section to ...
5 years, 2 months ago #9
Martin Panter
http://bugs.python.org/review/12067/diff/13054/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): http://bugs.python.org/review/12067/diff/13054/Doc/reference/expressions.rst#newcode1093 Doc/reference/expressions.rst:1093: otherwise, :exc:`TypeError` is raised: Fine by me. In the ...
5 years, 2 months ago #10
Jim.J.Jewett
Despite my comments suggesting further improvements, I believe it would be helpful to commit the ...
5 years, 2 months ago #11
andymaier
https://bugs.python.org/review/12067/diff/13054/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): https://bugs.python.org/review/12067/diff/13054/Doc/reference/expressions.rst#newcode1093 Doc/reference/expressions.rst:1093: otherwise, :exc:`TypeError` is raised: Done. https://bugs.python.org/review/12067/diff/13054/Doc/reference/expressions.rst#newcode1100 Doc/reference/expressions.rst:1100: also between ...
5 years, 2 months ago #12
andymaier
https://bugs.python.org/review/12067/diff/13054/Lib/test/test_compare.py File Lib/test/test_compare.py (right): https://bugs.python.org/review/12067/diff/13054/Lib/test/test_compare.py#newcode373 Lib/test/test_compare.py:373: (i1, i2, equal, comp, i1_meth, i2_meth) Will change to ...
5 years, 2 months ago #13
Martin Panter
Patch v11 looks pretty good I think http://bugs.python.org/review/12067/diff/13054/Lib/test/test_compare.py File Lib/test/test_compare.py (right): http://bugs.python.org/review/12067/diff/13054/Lib/test/test_compare.py#newcode100 Lib/test/test_compare.py:100: class Class_none(object): ...
5 years, 2 months ago #14
andymaier
https://bugs.python.org/review/12067/diff/13054/Lib/test/test_compare.py File Lib/test/test_compare.py (right): https://bugs.python.org/review/12067/diff/13054/Lib/test/test_compare.py#newcode100 Lib/test/test_compare.py:100: class Class_none(object): Ah! Silly me. That makes sense. There ...
5 years, 2 months ago #15
andymaier
https://bugs.python.org/review/12067/diff/13073/Lib/test/test_compare.py File Lib/test/test_compare.py (right): https://bugs.python.org/review/12067/diff/13073/Lib/test/test_compare.py#newcode301 Lib/test/test_compare.py:301: for t in (str, bytes, tuple, list, range, dict): ...
5 years, 2 months ago #16
andymaier
> tldr, make this sentence: "Strings and binary sequences cannot be directly > compared." Changed ...
5 years, 2 months ago #17
andymaier
http://bugs.python.org/review/12067/diff/13073/Lib/test/test_compare.py File Lib/test/test_compare.py (right): http://bugs.python.org/review/12067/diff/13073/Lib/test/test_compare.py#newcode301 Lib/test/test_compare.py:301: for t in (str, bytes, tuple, list, range, dict): ...
5 years, 1 month ago #18
Martin Panter
Hi Andy, here are some suggestions and comments. The only major issue is the one ...
4 years, 9 months ago #19
andymaier
Responded to Martin's comments. https://bugs.python.org/review/12067/diff/13975/Lib/test/test_compare.py File Lib/test/test_compare.py (right): https://bugs.python.org/review/12067/diff/13975/Lib/test/test_compare.py#newcode137 Lib/test/test_compare.py:137: class ComparisonTest2(unittest.TestCase): The new test ...
4 years, 9 months ago #20
Martin Panter
https://bugs.python.org/review/12067/diff/13975/Lib/test/test_compare.py File Lib/test/test_compare.py (right): https://bugs.python.org/review/12067/diff/13975/Lib/test/test_compare.py#newcode328 Lib/test/test_compare.py:328: def assert_insts(self, i1, i2, equal, comp, i1_meth=(), i2_meth=()): On ...
4 years, 9 months ago #21
storchaka
http://bugs.python.org/review/12067/diff/19802/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): http://bugs.python.org/review/12067/diff/19802/Doc/reference/expressions.rst#newcode1154 Doc/reference/expressions.rst:1154: 8-bit strings are fully interoperable in this behavior. [#]_ ...
2 years, 10 months ago #22
Martin Panter
http://bugs.python.org/review/12067/diff/19802/Doc/reference/expressions.rst File Doc/reference/expressions.rst (right): http://bugs.python.org/review/12067/diff/19802/Doc/reference/expressions.rst#newcode1154 Doc/reference/expressions.rst:1154: 8-bit strings are fully interoperable in this behavior. [#]_ ...
2 years, 10 months ago #23
storchaka
2 years, 10 months ago #24
http://bugs.python.org/review/12067/diff/19802/Doc/reference/expressions.rst
File Doc/reference/expressions.rst (right):

http://bugs.python.org/review/12067/diff/19802/Doc/reference/expressions.rst#...
Doc/reference/expressions.rst:1154: 8-bit strings are fully interoperable in
this behavior. [#]_
On 2017/01/22 06:22:58, vadmium wrote:
> On 2017/01/21 13:03:53, storchaka wrote:
> > This description is misleading. Unicode and 8-bit strings are not fully
> > interoperable.
> > 
> > >>> chr(0xff) == unichr(0xff)
> > __main__:1: UnicodeWarning: Unicode equal comparison failed to convert both
> > arguments to Unicode - interpreting them as being unequal
> > False
> > >>> chr(0xff) < unichr(0xff)
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0:
> ordinal
> > not in range(128)
> > 
> > When compare str and unicode, the str operand is converted to Unicode. If
the
> > conversion is failed, values are traited as non-equal.
> 
> Okay, I shall replace the second sentence with:
> 
> When comparing an 8-bit string and a Unicode string, the 8-bit string is
> converted to Unicode. If the conversion fails, the strings are considered
> unequal.

LGTM. Sorry, I'm not good in reviewing the documentation. I just checked some
technical details. You need other reviewer to checking your wording or just
commit your patch if you are feeling it correct (I trust your experience and
taste).
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+