rustpython_common/
rc.rs

1#[cfg(not(feature = "threading"))]
2use std::rc::Rc;
3#[cfg(feature = "threading")]
4use std::sync::Arc;
5
6// type aliases instead of newtypes because you can't do `fn method(self: PyRc<Self>)` with a
7// newtype; requires the arbitrary_self_types unstable feature
8
9#[cfg(feature = "threading")]
10pub type PyRc<T> = Arc<T>;
11#[cfg(not(feature = "threading"))]
12pub type PyRc<T> = Rc<T>;