Skip to content

Commit

Permalink
apply review comments
Browse files Browse the repository at this point in the history
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
  • Loading branch information
Icxolu and davidhewitt authored Oct 29, 2024
1 parent ff7cb80 commit 593a479
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion guide/src/class.md
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ Python::with_gil(|py| {
# .unwrap();
```

WARNING: `Py::new` and `.into_py` are currently inconsistent. Note how the constructed value is _not_ an instance of the specific variant. For this reason, constructing values is only recommended using `.into_py`.
WARNING: `Py::new` and `.into_pyobject` are currently inconsistent. Note how the constructed value is _not_ an instance of the specific variant. For this reason, constructing values is only recommended using `.into_pyobject`.

```rust
# use pyo3::prelude::*;
Expand Down
1 change: 1 addition & 0 deletions src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ use std::convert::Infallible;
/// # use pyo3::ffi;
/// #
/// Python::with_gil(|py| {
/// // ERROR: calling `.as_ptr()` will throw away the temporary object and leave `ptr` dangling.
/// let ptr: *mut ffi::PyObject = 0xabad1dea_u32.into_pyobject(py)?.as_ptr();
///
/// let isnt_a_pystring = unsafe {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_buffer_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn test_buffer_referenced() {
.into_pyobject(py)
.unwrap();

let buf = PyBuffer::<u8>::get(instance.as_any()).unwrap();
let buf = PyBuffer::<u8>::get(&instance).unwrap();
assert_eq!(buf.to_vec(py).unwrap(), input);
drop(instance);
buf
Expand Down

0 comments on commit 593a479

Please sign in to comment.