-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
BUG: Made setp
accept arbitrary iterables
#6217
BUG: Made setp
accept arbitrary iterables
#6217
Conversation
I don't think the broken Travis test is something I did... |
Also, while looking through some old code, I found the original use-case where this came up. It's actually not too contrived: |
There are a transient failures that we have not tracked down yet, restarted the test. |
@@ -1526,12 +1529,12 @@ def setp(obj, *args, **kwargs): | |||
>>> setp(line) | |||
... long output listing omitted | |||
|
|||
:func:`setp` operates on a single instance or a list of instances. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While minor, I think you should absorb the doc changes into your PR.
I think both of the fixes need to go in. One issue with listifying generators in functions is the side effect, ex def worker(inp):
inner = list(inp)
print("should count to {}".format(len(inner)))
gen_example = (j for j in range(15))
worker(gen_example)
for i in gen_example:
print(i) will not behave correctly (you can make this sort of thing work via |
Previously only accepted sequences. Fixes matplotlib#6212 Shamelessly borrows from `FIX: handle arbitrary iterables in setp matplotlib#6220`
a42f66c
to
8881680
Compare
I am leaning no on backporting unless someone disagrees. |
That makes perfect sense in this case. As the title indicates, this is not strictly even a bug. If it hasn't been fixed by now, it's been worked around or gone unnoticed. The work-around is simple enough that it doesn't need a backport. |
Previously only accepted sequences.
Fixes #6212