Opened 5 years ago

Closed 4 years ago

#14665 closed defect (invalid)

removing sage prompt from input does not work with line continuations

Reported by: vbraun Owned by: was
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: user interface Keywords:
Cc: jason, roed Merged in:
Authors: Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by vbraun)

This is super-annoying when pasting in multi-line doctests (both old and new-style line continuation):

sage: sage: 1+\
....: ....: 4
  File "<ipython-input-2-13f362a81816>", line 2
    ....: Integer(4)
    ^
SyntaxError: invalid syntax

With %cpaste:

sage: %cpaste
Pasting code; enter '--' alone on the line to stop or use Ctrl-D.
:   sage: 1 + \
:   ....: 4
:--
  File "<ipython-input-2-3a968492a164>", line 2
    ....: Integer(4)
    ^
SyntaxError: invalid syntax

Single line works:

sage: %cpaste
Pasting code; enter '--' alone on the line to stop or use Ctrl-D.
:   sage: 5
:--
5

Change History (6)

comment:1 Changed 5 years ago by vbraun

  • Description modified (diff)
  • Summary changed from %cpaste does not work with line continuations to removing sage prompt from input does not work with line continuations

comment:2 Changed 5 years ago by jdemeyer

These line continuations are non-standard and it might actually be best to never allow them.

comment:3 Changed 4 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:4 Changed 4 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:5 Changed 4 years ago by vbraun

  • Reviewers set to Jeroen Demeyer
  • Status changed from new to needs_review

comment:6 Changed 4 years ago by vbraun

  • Milestone changed from sage-6.2 to sage-duplicate/invalid/wontfix
  • Resolution set to invalid
  • Status changed from needs_review to closed
Note: See TracTickets for help on using tickets.