1 | initial version |
You can do, for example :
sage: from sage.symbolic.operators import add_vararg as plus
sage: (x+y).operator() == plus
True
sage: from sage.symbolic.operators import mul_vararg as multiply
sage: (x*y).operator() == multiply
True
2 | No.2 Revision |
You can do, for example define the plus
and multiply
operators as follows :
sage: from sage.symbolic.operators import add_vararg as plus
sage: (x+y).operator() == plus
True
plus
sage: from sage.symbolic.operators import mul_vararg as multiply multiply
Then,
sage: (x+y).operator() == plus
True
sage: (x*y).operator() == multiply
multiply
True
3 | No.3 Revision |
You can define the plus
and multiply
operators as follows :
sage: from sage.symbolic.operators import add_vararg as plus
sage: from sage.symbolic.operators import mul_vararg as multiply
Then,
sage: (x+y).operator() == plus
True
sage: (x*y).operator() == multiply
True
Note that the operators are not duplicated, but are the same in memory:
sage: (x+y).operator()
<function add_vararg at 0x7fcf50e86e18>
sage: plus
<function add_vararg at 0x7fcf50e86e18>
sage: (x+y).operator() is plus
True
4 | No.4 Revision |
You can define the plus
and multiply
operators as follows :
sage: from sage.symbolic.operators import add_vararg as plus
sage: from sage.symbolic.operators import mul_vararg as multiply
Then,
sage: (x+y).operator() == plus
True
sage: (x*y).operator() == multiply
True
Note that the operators are not duplicated, but are the same in memory:
sage: (x+y).operator()
<function add_vararg at 0x7fcf50e86e18>
sage: plus
<function add_vararg at 0x7fcf50e86e18>
sage: (x+y).operator() is plus
True