Skip to content

Commit

Permalink
feature gate deprecated APIs for PyEllipsis, PyNone and `PyNotImp…
Browse files Browse the repository at this point in the history
…lemented` (#4132)
  • Loading branch information
Icxolu committed Apr 27, 2024
1 parent 059c8b3 commit 6fb972b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
10 changes: 4 additions & 6 deletions src/types/ellipsis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ pyobject_native_type_extract!(PyEllipsis);

impl PyEllipsis {
/// Returns the `Ellipsis` object.
#[cfg_attr(
not(feature = "gil-refs"),
deprecated(
since = "0.21.0",
note = "`PyEllipsis::get` will be replaced by `PyEllipsis::get_bound` in a future PyO3 version"
)
#[cfg(feature = "gil-refs")]
#[deprecated(
since = "0.21.0",
note = "`PyEllipsis::get` will be replaced by `PyEllipsis::get_bound` in a future PyO3 version"
)]
#[inline]
pub fn get(py: Python<'_>) -> &PyEllipsis {
Expand Down
10 changes: 4 additions & 6 deletions src/types/none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ pyobject_native_type_extract!(PyNone);
impl PyNone {
/// Returns the `None` object.
/// Deprecated form of [`PyNone::get_bound`]
#[cfg_attr(
not(feature = "gil-refs"),
deprecated(
since = "0.21.0",
note = "`PyNone::get` will be replaced by `PyNone::get_bound` in a future PyO3 version"
)
#[cfg(feature = "gil-refs")]
#[deprecated(
since = "0.21.0",
note = "`PyNone::get` will be replaced by `PyNone::get_bound` in a future PyO3 version"
)]
#[inline]
pub fn get(py: Python<'_>) -> &PyNone {
Expand Down
10 changes: 4 additions & 6 deletions src/types/notimplemented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ pyobject_native_type_extract!(PyNotImplemented);

impl PyNotImplemented {
/// Returns the `NotImplemented` object.
#[cfg_attr(
not(feature = "gil-refs"),
deprecated(
since = "0.21.0",
note = "`PyNotImplemented::get` will be replaced by `PyNotImplemented::get_bound` in a future PyO3 version"
)
#[cfg(feature = "gil-refs")]
#[deprecated(
since = "0.21.0",
note = "`PyNotImplemented::get` will be replaced by `PyNotImplemented::get_bound` in a future PyO3 version"
)]
#[inline]
pub fn get(py: Python<'_>) -> &PyNotImplemented {
Expand Down

0 comments on commit 6fb972b

Please sign in to comment.