classification
Title: Issues with equality of inspect objects
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-05-16 09:54 by serhiy.storchaka, last changed 2015-07-18 20:38 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
inspect_eq.patch serhiy.storchaka, 2015-05-16 09:54 review
Messages (2)
msg243303 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-05-16 09:54
There are issues with implementations of equality in inspect classes.

1. __eq__ doesn't return NotImplemented. This causes that testing for equality with an instance of different classes always returns False, even when other class implements __eq__ that handles inspect class.

2. __ne__ returns False if __eq__ returns NotImplemented (in subclass).

3. All tests test only one of "==" or "!=" operations.

Proposed patch fixes these issues.
msg246912 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-07-18 20:22
New changeset 5ec2bfbe8115 by Serhiy Storchaka in branch '3.4':
Issue #24206: Fixed __eq__ and __ne__ methods of inspect classes.
https://hg.python.org/cpython/rev/5ec2bfbe8115

New changeset 66a5f66b4049 by Serhiy Storchaka in branch '3.5':
Issue #24206: Fixed __eq__ and __ne__ methods of inspect classes.
https://hg.python.org/cpython/rev/66a5f66b4049

New changeset adc9869c6d0d by Serhiy Storchaka in branch 'default':
Issue #24206: Fixed __eq__ and __ne__ methods of inspect classes.
https://hg.python.org/cpython/rev/adc9869c6d0d
History
Date User Action Args
2015-07-18 20:38:54serhiy.storchakasetstatus: open -> closed
assignee: serhiy.storchaka
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.4, Python 3.6
2015-07-18 20:22:41python-devsetnosy: + python-dev
messages: + msg246912
2015-05-16 09:54:36serhiy.storchakacreate