We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 242e511 commit ada0063Copy full SHA for ada0063
vm/src/builtins/set.rs
@@ -658,7 +658,11 @@ impl PySet {
658
}
659
660
#[pymethod(magic)]
661
- fn iand(zelf: PyRef<Self>, set: AnySet, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
+ fn iand(zelf: PyRef<Self>, set: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
662
+ if zelf.get_id() == set.get_id() {
663
+ return Ok(zelf);
664
+ }
665
+ let set = set.try_into_value::<AnySet>(vm)?;
666
zelf.inner
667
.intersection_update(std::iter::once(set.into_iterable(vm)?), vm)?;
668
Ok(zelf)
0 commit comments