Opened 22 months ago

Last modified 9 months ago

#22968 new defect

Handle %pprint correctly

Reported by: tmonteil Owned by:
Priority: major Milestone: sage-8.0
Component: user interface Keywords: pprint
Cc: vbraun, tscrim, chapoton, slelievre, slabbe Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by slelievre)

From the IPython REPL launched from Sage (by running sage --ipython in a terminal), we can switch off pretty printing as follows:

In [1]: [10**13]*5
Out[1]:
[10000000000000,
 10000000000000,
 10000000000000,
 10000000000000,
 10000000000000]

In [2]: %pprint
Pretty printing has been turned OFF

In [3]: [10**13]*5
Out[3]: [10000000000000, 10000000000000, 10000000000000, 10000000000000, 10000000000000]}}}

However, from the Sage REPL itself, or in a Sage Jupyter notebook, this does not work:

sage: [10^13]*5
[10000000000000,
 10000000000000,
 10000000000000,
 10000000000000,
 10000000000000]
sage: %pprint
Pretty printing has been turned OFF
sage: [10^13]*5
[10000000000000,
 10000000000000,
 10000000000000,
 10000000000000,
 10000000000000]

Does this come from a broken interaction with Sage's own pretty printing features (which focus more on latexing)?

This was reported on Ask Sage twice:

Change History (7)

comment:1 Changed 22 months ago by tmonteil

  • Description modified (diff)

comment:2 Changed 22 months ago by tmonteil

  • Description modified (diff)

comment:3 Changed 9 months ago by slelievre

  • Cc chapoton slelievre added
  • Description modified (diff)
  • Keywords pprint added

comment:4 Changed 9 months ago by slelievre

  • Description modified (diff)

comment:5 Changed 9 months ago by slelievre

  • Description modified (diff)
  • Summary changed from Sage's jupyter console does not handle %pprint correctly to Handle %pprint correctly

comment:6 Changed 9 months ago by slelievre

  • Description modified (diff)

comment:7 Changed 9 months ago by slabbe

  • Cc slabbe added
Note: See TracTickets for help on using tickets.