class xform_operator¶
Enumeration class: an operator that can be used in a transform query with step_xform.query().
This class is used when implementing step visitors. When you implement step_state.transition() as part of the overall task of subclassing step_state , you will use step_xform.query() invocations to inspect its step_xform arguments; these query invocations take xform_operator arguments.
xform_operator Members¶
| Constructors | none |
| Static Method | from_integer() |
| Methods | __cmp__(), __eq__(), __ge__(), __gt__(), __hash__(), __le__(), __lt__(), __ne__(), __repr__(), __str__(), as_integer(), name() |
| Attributes | EQUAL, GREATER_THAN_OR_EQUAL, LESS_THAN_OR_EQUAL, NOT_EQUAL |
xform_operator Details¶
-
class
cs.xform_operator¶ Enumeration class: an operator that can be used in a transform query with
step_xform.query().-
static
from_integer(_inner)¶ Construct an instance from an integer representation.
Parameters: _inner (int) – The integer representation, as returned by xform_operator.as_integer().Return type: xform_operatorRaises: result.ERROR_INVALID_ARGUMENTif_inneris not a valid integer representation for axform_operatorinstance.Invariant: For
xform_operatorx, xform_operator.from_integer(x.as_integer()) == x>>> xo = xform_operator.LESS_THAN_OR_EQUAL.as_integer() >>> xo 3 >>> xform_operator.from_integer(xo) <cs.xform_operator less_than_or_equal>
-
__cmp__(other)¶ Comparison function for
xform_operator, with respect to a stable overall ordering.Parameters: other ( xform_operator) – Thexform_operatorobject to compare against.Return type: int Returns: An integer N such that: - N==0 if the two objects compare equal
- N<0 if
self< other - N>0 if
self> other
>>> xform_operator.LESS_THAN_OR_EQUAL.__cmp__(xform_operator.NOT_EQUAL) 1
-
__eq__(b)¶ Equality operator for
xform_operator.Parameters: b ( xform_operator) – Thexform_operatorobject to compare against.Return type: bool Returns: Trueifselfandbcompare equal,Falseotherwise.>>> xform_operator.GREATER_THAN_OR_EQUAL == xform_operator.EQUAL False
-
__ge__(b)¶ Greater-than-or-equal operator for
xform_operator.Parameters: b ( xform_operator) – Thexform_operatorobject to compare against.Return type: bool Returns: Trueifself>=b,Falseotherwise.>>> xform_operator.GREATER_THAN_OR_EQUAL >= xform_operator.LESS_THAN_OR_EQUAL False
-
__gt__(b)¶ Greater-than operator for
xform_operator.Parameters: b ( xform_operator) – Thexform_operatorobject to compare against.Return type: bool Returns: Trueifself>b,Falseotherwise.>>> xform_operator.NOT_EQUAL > xform_operator.GREATER_THAN_OR_EQUAL False
-
__hash__()¶ Hash function for
xform_operator.Return type: int >>> hash(xform_operator.NOT_EQUAL) 1
-
__le__(b)¶ Less-than-or-equal operator for
xform_operator.Parameters: b ( xform_operator) – Thexform_operatorobject to compare against.Return type: bool Returns: Trueifself<=b,Falseotherwise.>>> xform_operator.LESS_THAN_OR_EQUAL <= xform_operator.EQUAL False
-
__lt__(b)¶ Less-than operator for
xform_operator.Parameters: b ( xform_operator) – Thexform_operatorobject to compare against.Return type: bool Returns: Trueifself<b,Falseotherwise.>>> xform_operator.NOT_EQUAL < xform_operator.EQUAL False
-
__ne__(b)¶ Inequality operator for
xform_operator.Parameters: b ( xform_operator) – Thexform_operatorobject to compare against.Return type: bool Returns: Falseifselfandbcompare equal,Trueotherwise.>>> xform_operator.LESS_THAN_OR_EQUAL != xform_operator.GREATER_THAN_OR_EQUAL True
-
__repr__()¶ Get a representation of a
xform_operatorobject that includes information useful for debugging.Return type: str Returns: The string representation. >>> repr(xform_operator.EQUAL) '<cs.xform_operator equal>'
-
__str__()¶ Get a simple string representation of a
xform_operatorobject.Return type: str Returns: The string representation. >>> str(xform_operator.NOT_EQUAL) 'not_equal'
-
as_integer()¶ Get an integer representation of
self.Return type: int Returns: An integer suitable for use with xform_operator.from_integer().Invariant: For
xform_operatorx, xform_operator.from_integer(x.as_integer()) == x>>> xo = xform_operator.LESS_THAN_OR_EQUAL.as_integer() >>> xo 3 >>> xform_operator.from_integer(xo) <cs.xform_operator less_than_or_equal>
-
name()¶ Get the name of a
xform_operatorobject.Return type: str Returns: The name. >>> xform_operator.LESS_THAN_OR_EQUAL.name() 'less_than_or_equal'
-
EQUAL¶ the == operator
>>> xform_operator.EQUAL <cs.xform_operator equal>
-
GREATER_THAN_OR_EQUAL¶ the >= operator
>>> xform_operator.GREATER_THAN_OR_EQUAL <cs.xform_operator greater_than_or_equal>
-
LESS_THAN_OR_EQUAL¶ the <= operator
>>> xform_operator.LESS_THAN_OR_EQUAL <cs.xform_operator less_than_or_equal>
-
NOT_EQUAL¶ the != operator
>>> xform_operator.NOT_EQUAL <cs.xform_operator not_equal>
-
static