Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG: Made `setp` accept arbitrary iterables #6217
Conversation
mdboom
added the
needs_review
label
Mar 24, 2016
|
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: |
tacaswell
referenced
this pull request
Mar 24, 2016
Closed
FIX: handle arbitrary iterables in setp #6220
|
There are a transient failures that we have not tracked down yet, restarted the test. |
madphysicist
commented on the diff
Mar 24, 2016
| @@ -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. |
madphysicist
Contributor
|
|
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 |
madphysicist
referenced
this pull request
Mar 24, 2016
Merged
ENH: Added `file` keyword to `setp` to redirect output #6222
tacaswell
merged commit d208471
into matplotlib:master
Mar 26, 2016
tacaswell
removed the
needs_review
label
Mar 26, 2016
|
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. |
madphysicist commentedMar 24, 2016
Previously only accepted sequences.
Fixes #6212