(_cls: &Py<PyType>, mapping: Self::Args, vm: &VirtualMachine)
| 63 | type Args = PyObjectRef; |
| 64 | |
| 65 | fn py_new(_cls: &Py<PyType>, mapping: Self::Args, vm: &VirtualMachine) -> PyResult<Self> { |
| 66 | if mapping.mapping_unchecked().check() |
| 67 | && !mapping.downcastable::<PyList>() |
| 68 | && !mapping.downcastable::<PyTuple>() |
| 69 | { |
| 70 | return Ok(Self { |
| 71 | mapping: MappingProxyInner::Mapping(ArgMapping::new(mapping)), |
| 72 | }); |
| 73 | } |
| 74 | Err(vm.new_type_error(format!( |
| 75 | "mappingproxy() argument must be a mapping, not {}", |
| 76 | mapping.class() |
| 77 | ))) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | #[pyclass(with( |
nothing calls this directly
no test coverage detected