Skip to content

Handling sets in cmp for dict view types #3298

Closed

Description

@DimitrisJim

Currently, sets are not handled in comparisons with dict views:

In Python:

>>> d = {1: 2}
>>> d.keys() == set([1])
True

while in RustPython:

>>>>> d = {1: 2}
>>>>> d.keys() == set([1])
False

In CPython, the corresponding implementation (dictview_richcompare) calls another function that iterates through the view and continuously calls __contains__ on the other object (see all_contained_in function).

Activity

  1. zetwhite commented on Oct 16, 2021

    @zetwhite
    Contributor

    Hi. Is there anyone working on this issue?
    If not, I'd like to work on it.

  2. DimitrisJim commented on Oct 16, 2021

    @DimitrisJim
    MemberAuthor

    @zetwhite no one else has requested so I'm assuming that no. Go for it!

  3. youknowone commented on Oct 23, 2021

    @youknowone
    Member

    I reviewed this issue but this is not a good first issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions