(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine)
| 44 | type Args = PyObjectRef; |
| 45 | |
| 46 | fn slot_new(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult { |
| 47 | let callable: Self::Args = args.bind(vm)?; |
| 48 | let doc = callable.get_attr("__doc__", vm); |
| 49 | |
| 50 | let result = Self { |
| 51 | callable: PyMutex::new(callable), |
| 52 | } |
| 53 | .into_ref_with_type(vm, cls)?; |
| 54 | let obj = PyObjectRef::from(result); |
| 55 | |
| 56 | if let Ok(doc) = doc { |
| 57 | obj.set_attr("__doc__", doc, vm)?; |
| 58 | } |
| 59 | |
| 60 | Ok(obj) |
| 61 | } |
| 62 | |
| 63 | fn py_new(_cls: &Py<PyType>, _args: Self::Args, _vm: &VirtualMachine) -> PyResult<Self> { |
| 64 | unimplemented!("use slot_new") |
nothing calls this directly
no test coverage detected