#16196: dedent pasted sage prompts
-------------------------------------+-------------------------------------
       Reporter:  vbraun             |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.2
      Component:  misc               |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  R. Andrew Ohana    |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/ohanar/ge_prompt_dedents         |  a1354669efb14821dda9c9c4c5d9361dc7d08bb2
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by ohanar):

 Replying to [comment:5 jhpalmieri]:
 > Oh, sorry, I didn't see this ticket and introduced #16232 which strips
 leading whitespace. Do we close that one as a duplicate? (Meanwhile, it
 has a positive review, by the way.)
 >
 > - Why only strip one prompt? I see the explanation that we are trying to
 match IPython's behavior, but do we need to preserve backward-
 compatibility?

 Is there permanent sage code that is being written with sage (duplicate)
 prompts? Really duplicate prompts should only come about by copying
 something into a terminal session, and then copying that pasted content
 again -- this seems like a complete edge case that wouldn't (and certainly
 shouldn't) show up in some code that is meant to be used for a long period
 of time.

 >
 > - What is the point of the change to
 `src/sage/repl/ipython_extension.py`? Just changing the regular expression
 (as at #16232) seems to solve the problem.

 IPython already has a dedenter, and it is smart (it strips an equal amount
 from each line), so all we need to do is strip our prompts after ipython
 dedents, and for the moment, that means insert after position 0 (and
 before position 1, so as to not re-break #16154).

--
Ticket URL: <http://trac.sagemath.org/ticket/16196#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to