Deprecate the PySet::empty
gil-ref constructor (#4082)
* Deprecate the `PySet::empty` gil-ref constructor * add newsfragment
This commit is contained in:
parent
8ed5c17b93
commit
a5201c04af
1
newsfragments/4082.changed.md
Normal file
1
newsfragments/4082.changed.md
Normal file
|
@ -0,0 +1 @@
|
|||
Deprecate the `PySet::empty()` gil-ref constructor.
|
|
@ -58,7 +58,14 @@ impl PySet {
|
|||
}
|
||||
|
||||
/// 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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue