(self)
| 1283 | /// T must be the exact payload type |
| 1284 | #[inline(always)] |
| 1285 | pub unsafe fn downcast_unchecked<T>(self) -> PyRef<T> { |
| 1286 | // PyRef::from_obj_unchecked(self) |
| 1287 | // manual impl to avoid assertion |
| 1288 | let obj = ManuallyDrop::new(self); |
| 1289 | PyRef { |
| 1290 | ptr: obj.ptr.cast(), |
| 1291 | } |
| 1292 | } |
| 1293 | |
| 1294 | // ideally we'd be able to define these in pyobject.rs, but method visibility rules are weird |
| 1295 |
no test coverage detected