[issue12067] Doc: remove errors about mixed-type comparisons.

2022-01-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Martin: [tests need review]. Yep. Improved constant folding and elimination of duplication now causes many 'is not' tests to fail. Language tests should not test current implementation limitations. -- ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2022-01-18 Thread Humbdrag
Change by Humbdrag : -- pull_requests: +28867 pull_request: https://github.com/python/cpython/pull/30667 ___ Python tracker ___ ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2022-01-17 Thread Humbled Drugman
Change by Humbled Drugman : -- pull_requests: +28852 pull_request: https://github.com/python/cpython/pull/30651 ___ Python tracker ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2022-01-16 Thread Humbled Drugman
Change by Humbled Drugman : -- nosy: +humbdrag nosy_count: 16.0 -> 17.0 pull_requests: +28828 pull_request: https://github.com/python/cpython/pull/30625 ___ Python tracker ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2022-01-16 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +28827 pull_request: https://github.com/python/cpython/pull/30624 ___ Python tracker ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-08-24 Thread Cheryl Sabella
Cheryl Sabella added the comment: I've created a PR for the changes to test_compare from v16 of the patch. -- ___ Python tracker ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-08-24 Thread Cheryl Sabella
Changes by Cheryl Sabella : -- pull_requests: +3238 ___ Python tracker ___ ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-06-05 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-06-05 Thread Martin Panter
Martin Panter added the comment: Yes I think I committed all the documentation. Someone needs to decide whether to use Andy’s tests as they are, or perhaps modify or drop some or all of them. -- ___ Python tracker

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-06-04 Thread Cheryl Sabella
Cheryl Sabella added the comment: It appears all the patches for this issue have been applied. Is the only open item the changes to test_compare? -- nosy: +csabella ___ Python tracker

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-01-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8c9a86aa222e by Martin Panter in branch '3.5': Issue #12067: Recommend that hash and equality be consistent https://hg.python.org/cpython/rev/8c9a86aa222e New changeset 9702c5f08df1 by Martin Panter in branch '3.6': Issues #12067: Merge hash

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-01-23 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file46399/expressions-py3.7_v17.diff ___ Python tracker ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-01-23 Thread Martin Panter
Martin Panter added the comment: Updated patch for 2.7, which I plan to commit soon. Corresponding Py 3 patch coming soon. -- Added file: http://bugs.python.org/file46398/expressions-py2.7_v17.diff ___ Python tracker

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-01-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +r.david.murray ___ Python tracker ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-01-21 Thread Martin Panter
Martin Panter added the comment: Here is a port of the documentation to Python 2. Main differences: * Default rules for order comparisons are different * Not all kinds of objects inherit from object() * str(), unicode() compatibility * xrange() only seems to have default comparability * NAN,

[issue12067] Doc: remove errors about mixed-type comparisons.

2017-01-19 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +Wrong documentation (Language Ref) for unicode and str comparison ___ Python tracker

[issue12067] Doc: remove errors about mixed-type comparisons.

2015-09-23 Thread Martin Panter
Martin Panter added the comment: I committed the changes to expressions.rst for 3.4+. That still leaves the changes to test_compare.py, and possibly changes for 2.7. Andy: In msg229721 you mentioned a potential 2.7 patch. Did you get anywhere with that? Even if it is only half finished,

[issue12067] Doc: remove errors about mixed-type comparisons.

2015-09-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1fc049e5ec14 by Martin Panter in branch '3.4': Issue #12067: Rewrite Comparisons section in the language reference https://hg.python.org/cpython/rev/1fc049e5ec14 New changeset b6698c00265b by Martin Panter in branch '3.5': Issue #12067: Merge

[issue12067] Doc: remove errors about mixed-type comparisons.

2015-07-28 Thread Martin Panter
Martin Panter added the comment: I can split out a documentation-only patch if it would help get that committed. In the meantime, patch v16 includes some fixups to comments etc in the test code that I missed myself. -- assignee: - docs@python components: +Tests Added file:

[issue12067] Doc: remove errors about mixed-type comparisons.

2015-07-21 Thread Martin Panter
Martin Panter added the comment: Patch v15. No doc changes, but I refactored the test code: * Manually merged with recent changes * Separate assert_equality_only() and assert_total_order() test methods. Hopefully this is a bit simpler for people to understand and review, and avoids suggesting

[issue12067] Doc: remove errors about mixed-type comparisons.

2015-07-21 Thread Berker Peksag
Berker Peksag added the comment: I think we can commit documentation and tests separately. I just did a quick review of the test changes and I will add some review comments later (sorry, lack of time :)). -- nosy: +berker.peksag ___ Python tracker

[issue12067] Doc: remove errors about mixed-type comparisons.

2015-07-21 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: -ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___ ___ Python-bugs-list

[issue12067] Doc: remove errors about mixed-type comparisons.

2015-03-02 Thread Andy Maier
Andy Maier added the comment: I have posted v14 of the patch (for the 3.5 'default' branch), based on Martin's v13. v14 addresses all comments Martin made, as described in my responses to them (see patch set 10). On Issue 4395: That issue should be pursued in addition to this issue; it seems

[issue12067] Doc: remove errors about mixed-type comparisons.

2015-03-02 Thread Andy Maier
Changes by Andy Maier andreas.r.ma...@gmx.de: Added file: http://bugs.python.org/file38303/issue12067-expressions-py3.5_v14.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2015-02-20 Thread Martin Panter
Martin Panter added the comment: Issue 4395 is already open for the != delegating to __eq__ issue that Guido pointed out earlier. Yet another issue that this doc patch should solve: Issue 22000. I am posting v13 of the patch that works with the current “default” (3.5) branch. Minor

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-20 Thread Andy Maier
Andy Maier added the comment: I have posted v12 of the patch, which addresses all comments since v11. This Python 3.4 patch can be applied to the default (3.5 dev) branch as well. I will start working on a similar patch for Python 2.7 now. -- Added file:

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-14 Thread Andy Maier
Andy Maier added the comment: I have addressed the comments by Jim Jewett, Martin Panter and of myself in a new version v11, which got posted. For the expression.rst doc file, this version of the patch has its diff sections in a logical order, so that the original text and the patched text

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-14 Thread Andy Maier
Andy Maier added the comment: I also made sure in both files that the line length of any changed or new lines is max 80. Sorry if that creates extra changes when looking at deltas between change sets. -- ___ Python tracker rep...@bugs.python.org

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-13 Thread Andy Maier
Andy Maier added the comment: @Guido: Agree to all you said in your #msg226496. There is additional information about comparison in: - Tutorial (5.8. Comparing Sequences and Other Types), - Library Reference (5.3. Comparisons), - Language Reference (3.3.1. Basic customization) that needs to be

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-13 Thread Andy Maier
Andy Maier added the comment: Uploading v10 of the patch, which addresses all review comments made on v9. There is one open question back to Martin Panter about which different types of byte sequences can be compared in Py 3.4. I also believe this patch addresses all of Issue 22001. Let me

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-13 Thread Andy Maier
Andy Maier added the comment: Here is the delta between v9 and v10 of the patch, if people want to see just that. -- Added file: http://bugs.python.org/file36897/issue12067-expressions-py34_delta-v9-v10.diff ___ Python tracker

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-13 Thread Martin Panter
Martin Panter added the comment: About the byte sequence comparisons, I wondered if it was misleading to say that a list(), tuple() or range() can only be compared to the same type, without mentioning that bytes() and bytearray() can be compared to each other. BTW just noticed you say range()

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-12 Thread Martin Panter
Martin Panter added the comment: Maybe it would be wise to split this task up and commit the bits that don’t need any more work. I think the existing patch might already solve Issue 22001. -- ___ Python tracker rep...@bugs.python.org

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-07 Thread Andy Maier
Andy Maier added the comment: Just wanted to say that i will continue working on this, working in the comments made so far... Andy -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-09-06 Thread Guido van Rossum
Guido van Rossum added the comment: - This bug should discuss doc updates, not question the rules. - The rules have evolved over time and the docs stayed behind. - We should definitely update the 2.7 docs as well as the 3.4 and 3.5 (in development) docs. The 2.7 docs need to be different

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-09-06 Thread Martin Panter
Martin Panter added the comment: The point about “a != b” deferring to “not a.__eq__(b)” is not documented anywhere that I am aware of. In fact the opposite is currently documented at https://docs.python.org/release/3.4.0/reference/datamodel.html#richcmpfuncs, so maybe this needs to be fixed,

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-09-06 Thread Guido van Rossum
Guido van Rossum added the comment: That's a pretty new feature. Someone probably forgot to clean up all the places where it was documented. On Sat, Sep 6, 2014 at 4:18 PM, Martin Panter rep...@bugs.python.org wrote: Martin Panter added the comment: The point about “a != b” deferring to

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-08-27 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___ ___ Python-bugs-list

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-08-18 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___ ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-16 Thread Andy Maier
Andy Maier added the comment: Uploaded v9 of the patch for 3.4 and default. It reflects Marc's comment, plus the result of the recent discussion on python-dev since v8 of th epatch, up to 2014-07-15 (subject: == on object tests identity in 3.x). - Please review the patch. -- Added

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-15 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: rhettinger - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___ ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-13 Thread Andy Maier
Changes by Andy Maier andreas.r.ma...@gmx.de: Added file: http://bugs.python.org/file35938/try_eq.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-13 Thread Andy Maier
Changes by Andy Maier andreas.r.ma...@gmx.de: Added file: http://bugs.python.org/file35939/try_eq.out ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-13 Thread Andy Maier
Andy Maier added the comment: Mark: Both are good points! Would you add the cases from your second comment under symmetry? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-11 Thread Andy Maier
Changes by Andy Maier andreas.r.ma...@gmx.de: -- nosy: +benjamin.peterson, steven.daprano ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-11 Thread Andy Maier
Changes by Andy Maier andreas.r.ma...@gmx.de: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___ ___ Python-bugs-list

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-11 Thread Andy Maier
Andy Maier added the comment: Uploaded v8 of the patch for 3.4 and default. It reflects hopefully everything that was said in this issue thread, and on the python-dev mailing list (subject: == on object tests identity in 3.x), at least to the extent it was related to comparisons. Besides the

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-11 Thread Mark Dickinson
Mark Dickinson added the comment: + In other words, the following expressions should have the same result: + +``x == y`` and ``not x != y`` + +``x y`` and ``not x = y`` + +``x y`` and ``not x = y`` I think the second and third items here go too far: sets don't obey these rules,

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-07 Thread Andy Maier
Andy Maier added the comment: I see. But I don't think it is a sensible default, as the source code states. The Python doc (v2 and v3) is quite consistent in stating that `==` compares the values of two objects, while `is` compares object identity. Having a default implementation on the

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-04 Thread Andy Maier
Andy Maier added the comment: Terry, I'd like to comment on your statement: 3. By default, == and /= compare identities. in msg148774. What experiment lead you to that conclusion? Here is one that contradicts it (using cpython 3.4.1): i1 = 42 f1 = 42.0 i1 == f1 True i1 is f1 False Is it

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-04 Thread Andy Maier
Andy Maier added the comment: Uploaded v5 of the patch. Changes: 1. The statement that comparison of different built-in types (always) raises TypeError, was too general. Changed to distinguish equal and order operators, as summarized by Ezio in items 3) and 4) of msg148760. 2. Ensured max

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-04 Thread Andy Maier
Andy Maier added the comment: It seems I still need to practice creating patches ... uploading v6 which should create a review link. No other changes. Sorry for that. Andy -- Added file: http://bugs.python.org/file35851/issue12067-expressions-py34_v6.diff

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-04 Thread Andy Maier
Andy Maier added the comment: Another attempt. Really sorry... -- Added file: http://bugs.python.org/file35853/issue12067-expressions-py34_v7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: In py3, *everything* is an instance of class object. This makes like simple than in 2.x. The default comparison rules are set by the rich comparison methods of object. 'By experiment' meant by experiments with instances of object, which use those default

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-03 Thread Andy Maier
Andy Maier added the comment: Hi, I'd like to revive this issue. IMHO, the changes in issue12067-expressions_v2.diff go too far. I don't think that deleting the entire section about the details of comparing objects of the same type makes sense. I agree with Terry's statement in msg170936

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-03 Thread Andy Maier
Changes by Andy Maier andreas.r.ma...@gmx.de: -- versions: +Python 3.5 -Python 3.2, Python 3.3 Added file: http://bugs.python.org/file35843/issue12067-expressions_v3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-03 Thread Andy Maier
Andy Maier added the comment: Uploaded issue12067-expressions_v3.diff for the 3.5 tip. Please review. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-03 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-03 Thread Andy Maier
Andy Maier added the comment: Uploaded issue12067-expressions_v4.diff to improve the unicode footnote 3, and to revert to using the term lexicographical for sequences (after learning that it applies there as well). Also, this version was produced using hg diff to make it properly reviewable.

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-07-03 Thread Andy Maier
Andy Maier added the comment: PS: The v4 patch does not address comments f) and h) from msg04, and it seems to me they do not need to be addressed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067

[issue12067] Doc: remove errors about mixed-type comparisons.

2013-03-08 Thread Mike Hoy
Mike Hoy added the comment: Considering that the docs have changed does this issue still need to be open? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2012-10-05 Thread Mike Hoy
Mike Hoy added the comment: Changed patch to include suggestions by Chris Jerdonek. http://bugs.python.org/issue12067#msg170953 -- hgrepos: +153 Added file: http://bugs.python.org/file27442/issue12067-expressions_v2.diff ___ Python tracker

[issue12067] Doc: remove errors about mixed-type comparisons.

2012-10-05 Thread Mike Hoy
Changes by Mike Hoy mho...@gmail.com: -- hgrepos: -153 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___ ___ Python-bugs-list mailing list

[issue12067] Doc: remove errors about mixed-type comparisons.

2012-09-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: Some minor comments: -The operators , , ``==``, ``=``, ``=``, and ``!=`` compare the +, , ``==``, ``=``, ``=``, and ``!=`` compare the values of two I think it reads better to start a sentence (and in this case a paragraph) with a word rather

[issue12067] Doc: remove errors about mixed-type comparisons.

2012-09-22 Thread Mark Dickinson
Mark Dickinson added the comment: I determined that 'raise TypeError' and 'return NotImplemented' both result in the call of the reflected method Are you sure? raise TypeError *should* result in the operation being abandoned, with the reflected operation not tried. Python 3.3.0rc2+

[issue12067] Doc: remove errors about mixed-type comparisons.

2012-09-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: You are right, I did not look deep enough. I was fooled by the conversion of NotImplemented, returned from object.__le__, etc, to TypeError. Sorry for that noise. For comparison and arithmetic, the actual alternative to defining a function that returns

[issue12067] Doc: remove errors about mixed-type comparisons.

2012-09-21 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___ ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2012-09-21 Thread Mike Hoy
Mike Hoy added the comment: http://bugs.python.org/issue15997 is this issue related to what Terry has mentioned: Does 'not supported' mean 'raises TypeError', 'returns NotImplemented', or both? If the last, I don't really understand the reason for NotImplemented versus TypeError. That point

[issue12067] Doc: remove errors about mixed-type comparisons.

2012-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: After further thought: This section is about the syntax operators, not the special methods. The syntax operators never evaluate to NotImplemented as they (apparently) interpret its return from a special method the same as a raising of TypeError, and always

[issue12067] Doc: remove errors about mixed-type comparisons.

2012-09-21 Thread Mike Hoy
Mike Hoy added the comment: I've attempted to incorporate both Terry's and Ezio's suggestions. Here is a patch to get started with. There is a section that has been deleted. Patch uploaded. -- keywords: +patch Added file: http://bugs.python.org/file27256/issue12067-expressions.diff

[issue12067] Doc: remove errors about mixed-type comparisons.

2012-09-07 Thread Mike Hoy
Changes by Mike Hoy mho...@gmail.com: -- nosy: +mikehoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___ ___ Python-bugs-list mailing list

[issue12067] Doc: remove errors about mixed-type comparisons.

2011-12-02 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Would it be ok to state that: 1) , , ==, =, =, and != compare the values of two objects; 2) the two objects don't necessarily have to be of the same type; 3) with == and !=, objects of different types compare unequal, unless they define a

[issue12067] Doc: remove errors about mixed-type comparisons.

2011-12-02 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: In Python 3, where all classes inherit from object, the default rules are, by experiment, (which someone can verify from the code) simpler than you stated. 3. By default, == and /= compare identities. 4. By default, order comparisons raise

[issue12067] Doc: remove errors about mixed-type comparisons.

2011-05-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: [Docs] If both are numbers, they are converted to a common type. [Terry] In any case, I think it is only true for built-in number types, It's not even true for built-in number types. When comparing an int with a float, it's definitely

[issue12067] Doc: remove errors about mixed-type comparisons.

2011-05-12 Thread Terry J. Reedy
New submission from Terry J. Reedy tjre...@udel.edu: Current 3.2 doc, 5.9. Comparisons, has this paragraph about mixed-type comparisons. The operators , , ==, =, =, and != compare the values of two objects. The objects need not have the same type. If both are numbers, they are converted to a

[issue12067] Doc: remove errors about mixed-type comparisons.

2011-05-12 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___ ___ Python-bugs-list

[issue12067] Doc: remove errors about mixed-type comparisons.

2011-05-12 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Can you provide a patch? -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___