This type corresponds to all objects of the PyObject type in the Python C API, and in particular all of the types that users are familiar with from the Python language itself.
You can perform basic arithmetic on python objects.
i1 : x = rs "5" o1 = 5 o1 : PythonObject of class int |
i2 : y = rs "2" o2 = 2 o2 : PythonObject of class int |
i3 : x + y o3 = 7 o3 : PythonObject of class int |
i4 : x - y o4 = 3 o4 : PythonObject of class int |
i5 : x * y o5 = 10 o5 : PythonObject of class int |
i6 : x / y o6 = 2.5 o6 : PythonObject of class float |
You can also compare them.
i7 : x > y o7 = true |
i8 : x == y o8 = false |
You can also perform operations on python objects and Macaulay2 things. The results will be returned as python objects.
i9 : x + 2 o9 = 7 o9 : PythonObject of class int |
Note that many keywords in Macaulay2 are mapped to a certain dunder method in Python. In particular,
The object PythonObject is a type, with ancestor class Thing.