Skip to content

Commit

Permalink
Restored deprecation warning for IntoPyArray::into_pyarray and `ToP…
Browse files Browse the repository at this point in the history
…yArray::to_pyarray`
  • Loading branch information
JRRudy1 authored and davidhewitt committed Oct 6, 2024
1 parent 0fc3b98 commit ae95f69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ pub trait IntoPyArray: Sized {
type Dim: Dimension;

/// Deprecated form of [`IntoPyArray::into_pyarray_bound`]
#[deprecated(
since = "0.21.0",
note = "will be replaced by `IntoPyArray::into_pyarray_bound` in the future"
)]
#[cfg(feature = "gil-refs")]
fn into_pyarray<'py>(self, py: Python<'py>) -> &'py PyArray<Self::Item, Self::Dim> {
Self::into_pyarray_bound(self, py).into_gil_ref()
Expand Down Expand Up @@ -149,6 +153,10 @@ pub trait ToPyArray {
type Dim: Dimension;

/// Deprecated form of [`ToPyArray::to_pyarray_bound`]
#[deprecated(
since = "0.21.0",
note = "will be replaced by `ToPyArray::to_pyarray_bound` in the future"
)]
#[cfg(feature = "gil-refs")]
fn to_pyarray<'py>(&self, py: Python<'py>) -> &'py PyArray<Self::Item, Self::Dim> {
Self::to_pyarray_bound(self, py).into_gil_ref()
Expand Down

0 comments on commit ae95f69

Please sign in to comment.