feature gate deprecated APIs for `PyEllipsis`, `PyNone` and `PyNotImplemented` (#4132)
This commit is contained in:
parent
059c8b3862
commit
6fb972b232
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue