Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature gate deprecated APIs for PyEllipsis, PyNone and PyNotImplemented #4132

Merged
merged 1 commit into from Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/types/ellipsis.rs
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
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
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