[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2017-03-24 Thread Xiang Zhang
Xiang Zhang added the comment: New changeset 78ad039bcf1a8c494cbc8e18380cc30665869c3e by Xiang Zhang in branch '3.6': bpo-26915: Test identity first in index() and count() of collections.abc.Sequence (GH-553) https://github.com/python/cpython/commit/78ad039bcf1a8c494cbc8e18380cc30665869c3e

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2017-03-24 Thread Xiang Zhang
Xiang Zhang added the comment: New changeset d5d3249e8a37936d32266fa06ac20017307a1f70 by Xiang Zhang in branch 'master': bpo-26915: Test identity first in membership operation in index() and count() methods of collections.abc.Sequence (GH-503)

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2017-03-17 Thread Larry Hastings
Changes by Larry Hastings : -- pull_requests: +609 ___ Python tracker ___ ___

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2017-03-07 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2017-03-07 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +454 ___ Python tracker ___ ___ Python-bugs-list

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2017-03-06 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +411 ___ Python tracker ___ ___ Python-bugs-list

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-07-24 Thread Xiang Zhang
Xiang Zhang added the comment: Ping again. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-07-06 Thread Xiang Zhang
Xiang Zhang added the comment: ping -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-06-04 Thread Xiang Zhang
Xiang Zhang added the comment: Oh, sorry. Make the __len__ signature wrong. Change it. -- Added file: http://bugs.python.org/file43190/issue26915_v4.patch ___ Python tracker

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-06-04 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for review Serhiy and nice thoughts. I make the class inherited directly from Sequence. So if the methods in Sequence are OK, the test class is OK. -- Added file: http://bugs.python.org/file43189/issue26915_v3.patch

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-06-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: needs patch -> patch review ___ Python tracker ___

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-06-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry, I was absentminded. In general the patch LGTM. But I think that using list subclass for tests is not a good idea. If we make a typo in CustomSequence method name (__contain__, inedx, coumt), the test is still passed. It would be better to use a

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-06-03 Thread Xiang Zhang
Xiang Zhang added the comment: Serhiy, actually the patch(issue26915_s2.patch) I uploaded early has tried to make Sequence.index and Sequence.count consistent. Maybe the issue stage is not right. -- ___ Python tracker

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-06-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: fixed -> stage: patch review -> needs patch ___ Python tracker ___

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-24 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-23 Thread Xiang Zhang
Xiang Zhang added the comment: Reopen this since the solution is not complete pointed out by Serhiy and the new patch has already been attached(s2). -- status: closed -> open ___ Python tracker

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-05 Thread Xiang Zhang
Xiang Zhang added the comment: Oops, I forgot about them. I think they should. Raymond mentioned count in msg75735. Attach patch to take them in. -- Added file: http://bugs.python.org/file42734/issue26915_s2.patch ___ Python tracker

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about Sequence.index and Sequence.count? -- ___ Python tracker ___

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-05 Thread Xiang Zhang
Xiang Zhang added the comment: In my opinion it's not worth. If there is such an operator in stdlib, I would expect more, exposing PyObject_RichCompareBool in Python level, providing a new operator like `===`. -- ___ Python tracker

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is it worth to add a function in the operator module that tests arguments for identity or equality? -- ___ Python tracker

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Xiang, hanks for the patch and for the link to Guido's opinion. Josh, I concur with your sentiments. In this case the burden is light and is likely to prevent future difficulties by keeping the container invariants intact. -- resolution: ->

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1c6cf4010df3 by Raymond Hettinger in branch 'default': Issue 26915: Add identity checks to the collections ABC __contains__ methods. https://hg.python.org/cpython/rev/1c6cf4010df3 -- nosy: +python-dev

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-03 Thread Xiang Zhang
Xiang Zhang added the comment: I agree with you josh. Actually that's what I want to know, consistency. But I don't mention it in my post, so Guido only gives what to do in this case. In this thread, it means does Python code have to keep the invariant mentioned in msg75735? --

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> rhettinger nosy: +serhiy.storchaka ___ Python tracker ___

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-03 Thread Josh Rosenberg
Josh Rosenberg added the comment: At some point someone really needs to decide if the C layer behavior of performing an identity test before full equality checking is something that should be emulated at the Python layer or not. The current state seems ridiculous, where C containers check

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-03 Thread Xiang Zhang
Xiang Zhang added the comment: Add issue number to test method name. -- Added file: http://bugs.python.org/file42688/issue26915_v2.patch ___ Python tracker

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-03 Thread SilentGhost
Changes by SilentGhost : -- nosy: +rhettinger, stutzbach stage: -> patch review type: -> behavior ___ Python tracker ___

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-03 Thread Xiang Zhang
Changes by Xiang Zhang : -- keywords: +patch Added file: http://bugs.python.org/file42687/issue26915.patch ___ Python tracker ___

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-05-03 Thread Xiang Zhang
New submission from Xiang Zhang: __contains__ operation in ItemsView, ValuesView and Sequence in collections.abc simply test equality with ==. This introduces inconsistent behaviour with built-in containers when encountering objects like NaN, which does not equal to itself. I asked something