#24569 closed enhancement (fixed)
py3 : caring for range again
Reported by:  chapoton  Owned by:  

Priority:  major  Milestone:  sage8.2 
Component:  python3  Keywords:  
Cc:  jdemeyer, tscrim, fbissey, embray  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  31eb6c7 (Commits, GitHub, GitLab)  Commit:  
Dependencies:  Stopgaps: 
Description
part of #16081
Change History (8)
comment:1 Changed 5 years ago by
 Branch set to u/chapoton/24569
 Commit set to c5b0e9dba123ad0e02ffccfd902611e7f24f6877
 Status changed from new to needs_review
comment:2 Changed 5 years ago by
green bot
comment:3 Changed 5 years ago by
The zip
should be able to handle this:

src/sage/plot/plot.py
diff git a/src/sage/plot/plot.py b/src/sage/plot/plot.py index 4322987..2928e09 100644
a b def list_plot_semilogy(data, plotjoined=False, **kwds): 3292 3292 3293 3293 :: 3294 3294 3295 sage: xl = [2**k for k in range(12)]; yl = range(len(xl))3295 sage: xl = [2**k for k in range(12)]; yl = list(range(len(xl))) 3296 3296 sage: list_plot_semilogy(list(zip(xl,yl))) # plot empty due to (1,0) 3297 3297 Graphics object consisting of 1 graphics primitive 3298 3298
and generates a list of tuples (via list(zip(...))
). So I think that change is unnecessary.
comment:4 Changed 5 years ago by
 Commit changed from c5b0e9dba123ad0e02ffccfd902611e7f24f6877 to 31eb6c72f542ababb2c42c074bd379ad3ebfaf51
Branch pushed to git repo; I updated commit sha1. New commits:
31eb6c7  trac 24569 undo change in plot

comment:5 Changed 5 years ago by
indeed. Undone
comment:6 Changed 5 years ago by
 Reviewers set to Travis Scrimshaw
 Status changed from needs_review to positive_review
Thanks.
comment:7 Changed 5 years ago by
 Branch changed from u/chapoton/24569 to 31eb6c72f542ababb2c42c074bd379ad3ebfaf51
 Resolution set to fixed
 Status changed from positive_review to closed
comment:8 Changed 5 years ago by
 Commit 31eb6c72f542ababb2c42c074bd379ad3ebfaf51 deleted
too late, but still (found by patchbot on #16081)
File "src/sage/plot/plot.py", line 3301, in sage.plot.plot.list_plot_semilogy Failed example: list_plot_semilogy(list(zip(xl[1:],yl[1:]))) Exception raised: Traceback (most recent call last): File "/home/chapoton/sage/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 533, in _run self.compile_and_execute(example, compiler, test.globs) File "/home/chapoton/sage/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 936, in compile_and_execute exec(compiled, globs) File "<doctest sage.plot.plot.list_plot_semilogy[4]>", line 1, in <module> list_plot_semilogy(list(zip(xl[Integer(1):],yl[Integer(1):]))) TypeError: sequence index must be integer, not 'slice'
Note: See
TracTickets for help on using
tickets.
New commits:
py3 : more care for range