Merge pull request #1702 from ohadravid/to-python-set-non-default-hashbuilder
Make `ToPyObject` impl for `HashSet` accept non-default hashers.
This commit is contained in:
commit
0215054012
|
@ -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
|
||||
|
||||
|
|
|
@ -192,9 +192,10 @@ impl<'a> std::iter::IntoIterator for &'a PySet {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> ToPyObject for collections::HashSet<T>
|
||||
impl<T, S> ToPyObject for collections::HashSet<T, S>
|
||||
where
|
||||
T: hash::Hash + Eq + ToPyObject,
|
||||
S: hash::BuildHasher + Default,
|
||||
{
|
||||
fn to_object(&self, py: Python) -> PyObject {
|
||||
let set = PySet::new::<T>(py, &[]).expect("Failed to construct empty set");
|
||||
|
|
Loading…
Reference in New Issue