We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As per the docs (and reproduced with pyo3 v0.8.5, python 3.7, ubuntu) PySet is not an iterator.
PySet
Therefore for element in my_set { throws an error.
for element in my_set {
I tried wrapping the set in PyList::new but got the trait std::iter::ExactSizeIterator is not implemented for &pyo3::types::PySet.
PyList::new
the trait std::iter::ExactSizeIterator is not implemented for &pyo3::types::PySet
Is there a good reason to prevent iteration over sets? If not could it be added, also is there a workaround for now?
The text was updated successfully, but these errors were encountered:
It seems to me that it is reasonable for PySet to implement this. (Have opened a PR.)
For now you can use for element in my_set.iter()? { thanks to the ObjectProtocol trait.
for element in my_set.iter()? {
ObjectProtocol
Sorry, something went wrong.
PySet.iter isn't documented as it is on PyList.
PySet.iter
PyList
But thank you.
Successfully merging a pull request may close this issue.
As per the docs (and reproduced with pyo3 v0.8.5, python 3.7, ubuntu)
PySet
is not an iterator.Therefore
for element in my_set {
throws an error.I tried wrapping the set in
PyList::new
but gotthe trait std::iter::ExactSizeIterator is not implemented for &pyo3::types::PySet
.Is there a good reason to prevent iteration over sets? If not could it be added, also is there a workaround for now?
The text was updated successfully, but these errors were encountered: