Create a `FnOnce()` that can easily be passed to a function like [`std::thread::Builder::spawn`] # Note If you return a `PyObjectRef` (or a type that contains one) from `F`, and don't `join()` on the thread this `FnOnce` runs in, there is a possibility that that thread will panic as `PyObjectRef`'s `Drop` implementation tries to run the `__del__` destructor of a Python object but finds that it's
(self, f: F)
| 538 | /// as `PyObjectRef`'s `Drop` implementation tries to run the `__del__` destructor of a |
| 539 | /// Python object but finds that it's not in the context of any vm. |
| 540 | pub fn make_spawn_func<F, R>(self, f: F) -> impl FnOnce() -> R |
| 541 | where |
| 542 | F: FnOnce(&VirtualMachine) -> R, |
| 543 | { |
| 544 | move || self.run(f) |
| 545 | } |
| 546 | |
| 547 | /// Run a function in this thread context |
| 548 | /// |
no test coverage detected