(zelf: &crate::Py<Self>, vm: &VirtualMachine)
| 1398 | impl SelfIter for PySetIterator {} |
| 1399 | impl IterNext for PySetIterator { |
| 1400 | fn next(zelf: &crate::Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> { |
| 1401 | let mut internal = zelf.internal.lock(); |
| 1402 | let next = if let IterStatus::Active(dict) = &internal.status { |
| 1403 | if dict.has_changed_size(&zelf.size) { |
| 1404 | internal.status = IterStatus::Exhausted; |
| 1405 | return Err(vm.new_runtime_error("set changed size during iteration")); |
| 1406 | } |
| 1407 | match dict.next_entry(internal.position) { |
| 1408 | Some((position, key, _)) => { |
| 1409 | internal.position = position; |
| 1410 | PyIterReturn::Return(key) |
| 1411 | } |
| 1412 | None => { |
| 1413 | internal.status = IterStatus::Exhausted; |
| 1414 | PyIterReturn::StopIteration(None) |
| 1415 | } |
| 1416 | } |
| 1417 | } else { |
| 1418 | PyIterReturn::StopIteration(None) |
| 1419 | }; |
| 1420 | Ok(next) |
| 1421 | } |
| 1422 | } |
| 1423 | |
| 1424 | fn vectorcall_set( |
nothing calls this directly
no test coverage detected