(
cls: PyTypeRef,
source: PyObjectRef,
vm: &VirtualMachine,
)
| 48 | |
| 49 | #[pyclassmethod] |
| 50 | fn from_iterable( |
| 51 | cls: PyTypeRef, |
| 52 | source: PyObjectRef, |
| 53 | vm: &VirtualMachine, |
| 54 | ) -> PyResult<PyRef<Self>> { |
| 55 | Self { |
| 56 | source: PyRwLock::new(Some(source.get_iter(vm)?)), |
| 57 | active: PyRwLock::new(None), |
| 58 | } |
| 59 | .into_ref_with_type(vm, cls) |
| 60 | } |
| 61 | |
| 62 | #[pyclassmethod] |
| 63 | fn __class_getitem__( |