(vm: &VirtualMachine, obj: PyObjectRef)
| 1337 | |
| 1338 | impl TryFromObject for AnySet { |
| 1339 | fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> { |
| 1340 | let class = obj.class(); |
| 1341 | if class.fast_issubclass(vm.ctx.types.set_type) |
| 1342 | || class.fast_issubclass(vm.ctx.types.frozenset_type) |
| 1343 | { |
| 1344 | Ok(Self { object: obj }) |
| 1345 | } else { |
| 1346 | Err(vm.new_type_error(format!("{class} is not a subtype of set or frozenset"))) |
| 1347 | } |
| 1348 | } |
| 1349 | } |
| 1350 | |
| 1351 | #[pyclass(module = false, name = "set_iterator")] |
nothing calls this directly
no test coverage detected