On Monday, August 28, 2017 at 3:45:23 AM UTC-7, Nicolas M. Thiéry wrote:
>
> Problem
> -------
>
> A dozen of our "print" are of the form "print(a,b)". In this case, the
> output differs between Python 2 and Python 3, which is annoying: we
> would like our examples to work with the current Sage. One workaround
> would be to use instead:
>
> print("%s %s"%(a,b))
>
> but that's really heavy handed.
At the expense of some extra parentheses:
>>> print ((a,b))
(a, b)
in both py2 and py3. In a calculus book, the format of printing is probably
not so important, so it seems to me the penalty for unmotivated
non-intuitive parentheses might be lower than the alternatives. It
basically means you'll only use print( <single python object> ), which
works consistently between py2 and py3. You could even put that in a
footnote to satisfy the curiosity of inquisitive students.
--
You received this message because you are subscribed to the Google Groups
"sage-devel" 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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.