(vm: &VirtualMachine, obj: &PyObject)
| 15 | |
| 16 | unsafe impl<T: PyPayload> TransmuteFromObject for PyRef<T> { |
| 17 | fn check(vm: &VirtualMachine, obj: &PyObject) -> PyResult<()> { |
| 18 | let class = T::class(&vm.ctx); |
| 19 | if obj.fast_isinstance(class) { |
| 20 | if obj.downcastable::<T>() { |
| 21 | Ok(()) |
| 22 | } else { |
| 23 | Err(vm.new_downcast_runtime_error(class, obj)) |
| 24 | } |
| 25 | } else { |
| 26 | Err(vm.new_downcast_type_error(class, obj)) |
| 27 | } |
| 28 | } |
| 29 | } |
nothing calls this directly
no test coverage detected