deprecate `PyFrozenSet::empty` (#3851)

This commit is contained in:
Icxolu 2024-02-17 14:40:54 +01:00 committed by GitHub
parent 1d8d81db2d
commit c33d330b18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -104,6 +104,13 @@ impl PyFrozenSet {
}
/// Deprecated form of [`PyFrozenSet::empty_bound`].
#[cfg_attr(
not(feature = "gil-refs"),
deprecated(
since = "0.21.0",
note = "`PyFrozenSet::empty` will be replaced by `PyFrozenSet::empty_bound` in a future PyO3 version"
)
)]
pub fn empty(py: Python<'_>) -> PyResult<&'_ PyFrozenSet> {
Self::empty_bound(py).map(Bound::into_gil_ref)
}