Macaulay2 » Documentation
Packages » Python » PythonObject » PythonObject ? PythonObject
next | previous | forward | backward | up | index | toc

PythonObject ? PythonObject -- compare Python objects

Description

Compare two Python objects. The result is one of the following symbols: <, >, ==, or incomparable.

i1 : toPython 2 ? toPython 3

o1 = <

o1 : Keyword

If one of the arguments is a Macaulay2 object, then it is first converted to a Python object before comparing.

i2 : toPython 4 ? 4

o2 = ==

o2 : Keyword
i3 : 7 ? toPython 6

o3 = >

o3 : Keyword

This method is used by the comparison operators <, >, <=, and >=.

i4 : toPython 2 < toPython 3

o4 = true
i5 : 4 >= toPython 5

o5 = false

See also

Ways to use this method:


The source of this document is in Python/doc/comparison.m2:38:0.