diff --git a/guide/src/conversions/tables.md b/guide/src/conversions/tables.md index 0b5d5973..38ed27c1 100644 --- a/guide/src/conversions/tables.md +++ b/guide/src/conversions/tables.md @@ -33,6 +33,7 @@ The table below contains the Python type and the corresponding function argument | `datetime.time` | - | `&PyTime` | | `datetime.tzinfo` | - | `&PyTzInfo` | | `datetime.timedelta` | - | `&PyDelta` | +| `collections.abc.Buffer` | - | `PyBuffer` | | `typing.Optional[T]` | `Option` | - | | `typing.Sequence[T]` | `Vec` | `&PySequence` | | `typing.Mapping[K, V]` | `HashMap`, `BTreeMap`, `hashbrown::HashMap`[^2], `indexmap::IndexMap`[^3] | `&PyMapping` | diff --git a/src/buffer.rs b/src/buffer.rs index f567176f..d3be9ee6 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -189,7 +189,7 @@ impl<'source, T: Element> FromPyObject<'source> for PyBuffer { } impl PyBuffer { - /// Get the underlying buffer from the specified python object. + /// Gets the underlying buffer from the specified python object. pub fn get(obj: &PyAny) -> PyResult> { // TODO: use nightly API Box::new_uninit() once stable let mut buf = Box::new(mem::MaybeUninit::uninit()); @@ -616,8 +616,10 @@ impl PyBuffer { } } - /// Release the buffer object, freeing the reference to the Python object + /// Releases the buffer object, freeing the reference to the Python object /// which owns the buffer. + /// + /// This will automatically be called on drop. pub fn release(self, _py: Python<'_>) { // First move self into a ManuallyDrop, so that PyBuffer::drop will // never be called. (It would acquire the GIL and call PyBuffer_Release