Ask Your Question

Revision history [back]

Sage is based on Interactive Python. Therefore, every feature in IPython works in SageMath. For example, one feature is automatic-parentheses-and-quotes.

So, if you are too lazy to write parenthesis and commas, then you can turn on the autocall magic and use it by starting the line by /:

sage: %autocall 1
Automatic calling is: Smart
sage: f(x,y,z) = x + y^2 + z^3
sage: /f x+1 y+2 z+3                  # no parenthesis, no comma!
(z + 3)^3 + (y + 2)^2 + x + 1

There is also the auto-quoting which can be used if you are too lazy to quote strings. It may be activated by starting the line with a comma:

sage: ,print aujourd'hui                # no parenthesis, no comma, no quotes "" !
aujourd'hui

Sage is based on Interactive Python. Therefore, every feature in IPython works in SageMath. For example, one feature is automatic-parentheses-and-quotes.

So, if you are too lazy to write parenthesis and commas, then you can turn on the autocall magic and use it by starting the line by /:

sage: %autocall 1
Automatic calling is: Smart
sage: f(x,y,z) = x + y^2 + z^3
sage: /f x+1 y+2 z+3                  # no parenthesis, no comma!
(z + 3)^3 + (y + 2)^2 + x + 1

There is also the auto-quoting which can be used if you are too lazy to quote strings. It may be activated by starting the line with a comma:

sage: ,print aujourd'hui                # no parenthesis, no comma, no quotes "" !
aujourd'hui

For more information and options, see the documentation of IPython on the link above or as follows:

$ sage -ipython
Python 3.11.1 (main, Sep  2 2023, 13:40:58) [GCC 9.4.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.6.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: ?