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

set intersection_update, difference_update, symmetric_difference_update should check self is equal to given arg #3881

Open
Snowapril opened this issue Jul 14, 2022 · 1 comment · May be fixed by #3912
Assignees
Labels
A-design compat good first issue

Comments

@Snowapril
Copy link
Contributor

@Snowapril Snowapril commented Jul 14, 2022

Feature

They are also relevant to inplace operations( iand, isub, ixor ).
CPython checks whether given argument and selfobject are equal and then returns.

  • intersection_update : If self == arg, returns self.copy()
  • difference_update : If self == arg, returns self.clear(); Ok(())
  • symmetric_difference_update : If self == arg, returns self.clear(); Ok(())

At the current implementation, they get a parameter as SetIterable which is converted from PyObjectRef before entering each method.
For checking self == arg, we should convert it after checking.

Python Documentation

Relevant Test Case

  • test_set.py test_inplace_on_self
@fanninpm fanninpm added good first issue compat A-design labels Jul 14, 2022
@kth496
Copy link
Contributor

@kth496 kth496 commented Jul 15, 2022

@youknowone Could you assign me to this issue? 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-design compat good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants