diff --git a/CHANGELOG.md b/CHANGELOG.md index 442a2365..7fa99062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Implement type information for conversion failures. [#1050](https://github.com/PyO3/pyo3/pull/1050) - Add `PyBytes::new_with` and `PyByteArray::new_with` for initialising Python-allocated bytes and bytearrays using a closure. [#1074](https://github.com/PyO3/pyo3/pull/1074) - Add `Py::as_ref` and `Py::into_ref`. [#1098](https://github.com/PyO3/pyo3/pull/1098) +- Add optional implementations of `ToPyObject`, `IntoPy`, and `FromPyObject` for [hashbrown](https://crates.io/crates/hashbrown)'s `HashMap` and `HashSet` types. The `hashbrown` feature must be enabled for these implementations to be built. [#1114](https://github.com/PyO3/pyo3/pull/1114/) ### Changed - Exception types have been renamed from e.g. `RuntimeError` to `PyRuntimeError`, and are now only accessible by `&T` or `Py` similar to other Python-native types. The old names continue to exist but are deprecated. [#1024](https://github.com/PyO3/pyo3/pull/1024) diff --git a/guide/src/conversions.md b/guide/src/conversions.md index 3c029442..df6d4065 100644 --- a/guide/src/conversions.md +++ b/guide/src/conversions.md @@ -24,10 +24,10 @@ The table below contains the Python type and the corresponding function argument | `float` | `f32`, `f64` | `&PyFloat` | | `complex` | `num_complex::Complex`[^1] | `&PyComplex` | | `list[T]` | `Vec` | `&PyList` | -| `dict[K, V]` | `HashMap`, `BTreeMap` | `&PyDict` | +| `dict[K, V]` | `HashMap`, `BTreeMap`, `hashbrown::HashMap`[^2] | `&PyDict` | | `tuple[T, U]` | `(T, U)`, `Vec` | `&PyTuple` | -| `set[T]` | `HashSet`, `BTreeSet` | `&PySet` | -| `frozenset[T]` | `HashSet`, `BTreeSet` | `&PyFrozenSet` | +| `set[T]` | `HashSet`, `BTreeSet`, `hashbrown::HashSet`[^2] | `&PySet` | +| `frozenset[T]` | `HashSet`, `BTreeSet`, `hashbrown::HashSet`[^2] | `&PyFrozenSet` | | `bytearray` | `Vec` | `&PyByteArray` | | `slice` | - | `&PySlice` | | `type` | - | `&PyType` | @@ -250,3 +250,4 @@ fn main() { [`PyRefMut`]: https://docs.rs/pyo3/latest/pyo3/pycell/struct.PyRefMut.html [^1]: Requires the `num-complex` optional feature. +[^2]: Requires the `hashbrown` optional feature.