Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant __ne__ implementations #67515

Closed
serhiy-storchaka opened this issue Jan 26, 2015 · 10 comments
Closed

Remove redundant __ne__ implementations #67515

serhiy-storchaka opened this issue Jan 26, 2015 · 10 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 23326
Nosy @gvanrossum, @rhettinger, @vstinner, @vadmium, @serhiy-storchaka
Files
  • remove___ne__.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2015-01-31.16:34:40.179>
    created_at = <Date 2015-01-26.21:34:39.091>
    labels = ['type-feature', 'library']
    title = 'Remove redundant __ne__ implementations'
    updated_at = <Date 2015-03-30.19:32:29.666>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2015-03-30.19:32:29.666>
    actor = 'gvanrossum'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-01-31.16:34:40.179>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2015-01-26.21:34:39.091>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['37869']
    hgrepos = []
    issue_num = 23326
    keywords = ['patch']
    message_count = 10.0
    messages = ['234779', '235088', '235100', '235118', '235121', '239620', '239626', '239629', '239633', '239635']
    nosy_count = 6.0
    nosy_names = ['gvanrossum', 'rhettinger', 'vstinner', 'python-dev', 'martin.panter', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue23326'
    versions = ['Python 3.5']

    @serhiy-storchaka
    Copy link
    Member Author

    As far as default __ne__ implementation delegates to __eq__, concrete __ne__ implementations are mostly redundant. They make sens when default __ne__ did not handle non-comparable types correctly, but now it is fixed. Proposed patch removes correct but redundant __ne__ implementations (incorrect implementations were removed in bpo-21408).

    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jan 26, 2015
    @vadmium
    Copy link
    Member

    vadmium commented Jan 31, 2015

    I looked at all the instances of __ne__() identified in the patch, and they all seem redundant with the __eq__() implementations, so I think this patch is good.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 31, 2015

    New changeset 3603bae63c13 by Serhiy Storchaka in branch 'default':
    Issue bpo-23326: Removed __ne__ implementations. Since fixing default __ne__
    https://hg.python.org/cpython/rev/3603bae63c13

    @serhiy-storchaka
    Copy link
    Member Author

    Thanks Martin and Georg for your reviews.

    @rhettinger
    Copy link
    Contributor

    Nice work.

    @gvanrossum
    Copy link
    Member

    I'm a little surprised you didn't get pushback from asyncio (i.e. Victor). We try to keep the source identical across releases while asyncio is in provisional mode (i.e. until 3.5 is released).

    @serhiy-storchaka
    Copy link
    Member Author

    Should I restore __ne__ in asyncio? The version without __ne__ will work with Python 3.4.3 because bpo-21408 patch was committed in 3.4 too. Explicit __ne__ implementation is just redundant.

    @gvanrossum
    Copy link
    Member

    Yeah, I'd like to see it restored in asyncio. It seems to be just one file
    that's currently out of sync with the tulip "upstream" repo.

    On Mon, Mar 30, 2015 at 10:38 AM, Serhiy Storchaka <report@bugs.python.org>
    wrote:

    Serhiy Storchaka added the comment:

    Should I restore __ne__ in asyncio? The version without __ne__ will work
    with Python 3.4.3 because bpo-21408 patch was committed in 3.4 too.
    Explicit __ne__ implementation is just redundant.

    ----------


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue23326\>


    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 30, 2015

    New changeset e881444f078f by Serhiy Storchaka in branch 'default':
    Partially revert 3603bae63c13 (bpo-23326) for asyncio.
    https://hg.python.org/cpython/rev/e881444f078f

    @gvanrossum
    Copy link
    Member

    Thanks!

    On Mon, Mar 30, 2015 at 12:26 PM, Roundup Robot <report@bugs.python.org>
    wrote:

    Roundup Robot added the comment:

    New changeset e881444f078f by Serhiy Storchaka in branch 'default':
    Partially revert 3603bae63c13 (bpo-23326) for asyncio.
    https://hg.python.org/cpython/rev/e881444f078f

    ----------


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue23326\>


    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants