diff --git a/CHANGELOG.md b/CHANGELOG.md index 56da0781c15..bfabcc32780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Use `METH_FASTCALL` argument passing convention, when possible, to improve `#[pyfunction]` and method performance. [#1619](https://github.com/PyO3/pyo3/pull/1619), [#1660](https://github.com/PyO3/pyo3/pull/1660) - Make the `Py_tracefunc` parameter of the `PyEval_SetProfile`/`PyEval_SetTrace` functions optional. [#1692](https://github.com/PyO3/pyo3/pull/1692) +- Make `ToPyObject` impl for `HashSet` accept non-default hashers. [#1702](https://github.com/PyO3/pyo3/pull/1702) ### Removed diff --git a/src/types/set.rs b/src/types/set.rs index dc5246419d6..6b664526343 100644 --- a/src/types/set.rs +++ b/src/types/set.rs @@ -183,9 +183,10 @@ impl<'a> std::iter::IntoIterator for &'a PySet { } } -impl ToPyObject for collections::HashSet +impl ToPyObject for collections::HashSet where T: hash::Hash + Eq + ToPyObject, + S: hash::BuildHasher + Default, { fn to_object(&self, py: Python) -> PyObject { let set = PySet::new::(py, &[]).expect("Failed to construct empty set");