-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
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
Set iteration is broken over sets created with iterators #3933
Comments
comment:1
The examples should read
and
|
comment:3
amusingly:
|
comment:4
Also, I was worried about giving it an infinite iterator, but it seems Python is happy to shoot itself in the foot:
|
comment:5
Attachment: trac-3933.patch.gz |
comment:6
This works and passes tests. So I give it a positive review. |
comment:7
Merged in Sage 3.3.alpha3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works:
sage: list(Set([1, 2, 3, 4, 5]))
[1, 2, 3, 4, 5]
But this doesn't:
sage: list(Set(iter([1, 2, 3, 4, 5])))
[]
Basically Set makes a Set_object() out of it and Set_object is really not prepared to deal with an iterator. I glanced over the code and did find an obvious solution.
Component: misc
Issue created by migration from https://trac.sagemath.org/ticket/3933
The text was updated successfully, but these errors were encountered: