having trouble entering multiline code

Skip to first unread message

John Cremona

Mar 22, 2021, 6:07:16 AMMar 22
to SAGE support
I havethe problem reported here -- but apparently solved in ipython
7.1.1, but I am using sage-9.2 with ipython 7.13.0 (as reported by
"sage -ipython").

I start entering a loop like this

sage: for n in [1..10]:
....: m=2*n

where ipython automatically enters the continuation "....:" and
indentation, but after hitting return the second time, immediately
after the n in the second line, it evaluates what I have entered so
far (uselessly) and gives me a new Sage prompt.

I know that this seems to be an ipython issue, but there is no problem
if I use sage -ipython directly (using range() instead of [..]) *and*
no problem in Sage if instead I do "for n in range(10):" in the first
line. So this seems to be being caused by whatever Sage does to
convert [1..10] into python.



Jun 10, 2021, 8:22:01 AMJun 10
to sage-support
2021-03-22, John Cremona:
> I have the problem reported here -- but apparently solved in ipython
Confirmed here. Now tracked at:

- Sage Trac ticket 31951
  Fix `..` ellipsis interference with REPL multiline input
Reply all
Reply to author
0 new messages