#14266: Pretty Console Output --> ascii art
---------------------------------------+------------------------------------
Reporter: elixyre | Owner: was
Type: task | Status: needs_review
Priority: major | Milestone: sage-5.9
Component: user interface | Resolution:
Keywords: ascii-art | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Jean-Baptiste Priez | Merged in:
Dependencies: | Stopgaps:
---------------------------------------+------------------------------------
Comment (by tscrim):
Replying to [comment:15 vbraun]:
> Some of the names are awkward in English. Pretty console representation
means that the console is pretty, not the repr(esentation). It would be
nice (and it would make writing doctests easier) if we install a global
function analogous to `repr()` to get the ascii art representation. I
would suggest we call it `display()` and the magic `%display` (instead of
`%pcp`, unless you want to use it as a pun on the hallucinogenic drug).
I'm not a big fan of `%display`, it's somewhat vague as a true/false. How
about `%ascii_art` or have `%display` accept a string input such as
`"ascii_art"` incase we end up with more display types later on? (I think
if you see ascii art, you're trippin' on some `%pcp` O_o )
>
> Similarly, I don't like `__pretty_repr__`. Its not a variant of
`__repr__` with pretty output since it returns a specialized object
instead of a string. Its also not a Python builtin, so Sage coding style
would use only single underscores. How about we call it `_ascii_art_()`?
Similarly, `set_display` instead of `set_pretty_repr`.
I like the `_ascii_art_()`. However I would rather this be converted into
using the `GlobalOptions` framework instead of a separate function and
attribute (tableaux already has this, and I can do it for Dyck paths if
preferred). We can also use this for partitions as well.
> Also, since this should be a general framework we should add a default
`_ascii_art_` method (with suitable documentation to benefit developers)
to `SageObject`.
+1
@Jean-Baptiste
I would also like to see `AsciiArt` inherit from `SageObject` as well, and
subsequently use `_repr_` instead of `__repr__` (1 underscore instead of
2). Also I would like to see the trailing whitespace removed from the new
lines you've added, but this is not too important. (I like your ascii art
in the beginning, too bad it's not of a sage [okay, I'm done with bad puns
for now, promise].)
Thanks,[[BR]]
Travis
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14266#comment:16>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.