Deprecate the `PySet::empty` gil-ref constructor (#4082)
* Deprecate the `PySet::empty` gil-ref constructor * add newsfragment
This commit is contained in:
parent
4f7c7065c2
commit
bd15f92a56
|
@ -0,0 +1 @@
|
||||||
|
Deprecate the `PySet::empty()` gil-ref constructor.
|
|
@ -58,7 +58,14 @@ impl PySet {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deprecated form of [`PySet::empty_bound`].
|
/// Deprecated form of [`PySet::empty_bound`].
|
||||||
pub fn empty(py: Python<'_>) -> PyResult<&'_ PySet> {
|
#[cfg_attr(
|
||||||
|
not(feature = "gil-refs"),
|
||||||
|
deprecated(
|
||||||
|
since = "0.21.2",
|
||||||
|
note = "`PySet::empty` will be replaced by `PySet::empty_bound` in a future PyO3 version"
|
||||||
|
)
|
||||||
|
)]
|
||||||
|
pub fn empty(py: Python<'_>) -> PyResult<&PySet> {
|
||||||
Self::empty_bound(py).map(Bound::into_gil_ref)
|
Self::empty_bound(py).map(Bound::into_gil_ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue