3 ms·
> Does a ref counted arg transfer the ref or does it take its own ref? This sort of thing also comes up a lot when you write Python extensions in C. You have t
by oconnor663 2y ago
> Does a ref counted arg transfer the ref or does it take its own ref?
This sort of thing also comes up a lot when you write Python extensions in C. You have to know the "calling convention" when you pass object refs in and out of functions. This entire category of problems goes away when you write extensions in Rust with PyO3, and the barrier to entry for new folks is much lower. C++ can do similar things (std::shared_ptr), but it tends to introduce new footguns in a way that Rust really doesn't.