Opened 11 years ago
Closed 10 years ago
#10478 closed enhancement (fixed)
line() does not accept iterators
Reported by: | ddrake | Owned by: | jason, was |
---|---|---|---|
Priority: | major | Milestone: | sage-4.6.2 |
Component: | graphics | Keywords: | line plot iterator |
Cc: | Merged in: | sage-4.6.2.alpha1 | |
Authors: | Dan Drake | Reviewers: | Robert Bradshaw |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
The line()
function fails when given an iterator:
sage: line(iter([(0,0), (1,0), (2,2)])) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [...] /opt/sage/local/lib/python2.6/site-packages/sage/plot/plot.pyc in xydata_from_point_list(points) 2529 pass 2530 -> 2531 if len(points)>0 and len(list(points[0]))!=2: 2532 raise ValueError, "points must have 2 coordinates in a 2d line" 2533 TypeError: object of type 'listiterator' has no len()
Attachments (1)
Change History (9)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
- Status changed from new to needs_review
I'm marking this as "needs review" because it is ready for review -- I hope someone can explain the above test failures so I can fix them.
comment:3 Changed 11 years ago by
The doctest failures are due to an internal counter used for uniqification. You can just change them to the new output, or "texture..."
Changed 10 years ago by
comment:4 Changed 10 years ago by
New patch up; I just used the new values for the textures to fix the doctests. Please review.
comment:5 Changed 10 years ago by
- Status changed from needs_review to positive_review
Looks good to me.
comment:6 Changed 10 years ago by
- Type changed from defect to enhancement
comment:7 Changed 10 years ago by
- Reviewers set to Robert Bradshaw
comment:8 Changed 10 years ago by
- Merged in set to sage-4.6.2.alpha1
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Here's a patch which corrects the problem, but on my test machine, I'm getting doctest errors in
shapes2.py
just like those reported at #9088:That ticket got merged and it doesn't look like anyone fixed those doctests, but they haven't been failing...so I'm not sure what's going on.