Skip to content

Conversation

bearney74
Copy link
Contributor

updated &= and -= so that it produces the right result when you do an operation on self:
s=set()
s &= s
s -= s

Copy link
Contributor

@fanninpm fanninpm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.


The parts that say

for item in temp_inner.elements() {
    self.add(item, vm)?;
}

seem inefficient to me, but I'm not sure if RustPython provides a more efficient way than this O(n) approach.

@DimitrisJim
Copy link
Member

DimitrisJim commented Mar 27, 2023

Yeah I think we should merge this but open an issue for the fact that we can skip many iterations knowing that the argument is actually self. See my comment here for a bit on this.

@youknowone youknowone added C-bug Something isn't working A-stdlib labels Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stdlib C-bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants