class xr_occ_iter_flags

Flag class: properties for xr_occurrence_iterator and xr_homonym_iterator iterators.

xr_occ_iter_flags Details

class cs.xr_occ_iter_flags

Flag class: properties for xr_occurrence_iterator and xr_homonym_iterator iterators.

static from_integer(_inner)

Construct an instance from an integer representation.

Parameters:_inner (int) – The integer representation, as returned by xr_occ_iter_flags.as_integer().
Return type:xr_occ_iter_flags
Raises:result.ERROR_INVALID_ARGUMENT if _inner is not a valid integer representation for a xr_occ_iter_flags instance.

Invariant: For xr_occ_iter_flags x, xr_occ_iter_flags.from_integer(x.as_integer()) == x

>>> xoi = (xr_occ_iter_flags.POPULATE_COUNTERS | xr_occ_iter_flags.DONTCARE_COMPLETE).as_integer()
>>> xoi
20
>>> xr_occ_iter_flags.from_integer(xoi)
<cs.xr_occ_iter_flags dontcare_complete|populate_counters>
__and__(b)

AND operator for xr_occ_iter_flags .

Parameters:b (xr_occ_iter_flags) – AND operand.
Return type:xr_occ_iter_flags
Returns:A xr_occ_iter_flags object containing all flags that are in both self and b.
>>> xr_occ_iter_flags.NONE & xr_occ_iter_flags.DROP_LIBMODEL_DEFS
<cs.xr_occ_iter_flags none>
__cmp__(other)

Comparison function for xr_occ_iter_flags , with respect to a stable overall ordering.

Parameters:other (xr_occ_iter_flags) – The xr_occ_iter_flags object 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
>>> xr_occ_iter_flags.DROP_LIBMODEL_DEFS.__cmp__(xr_occ_iter_flags.NONE)
1
__eq__(b)

Equality operator for xr_occ_iter_flags .

Parameters:b (xr_occ_iter_flags) – The xr_occ_iter_flags object to compare against.
Return type:bool
Returns:True if self and b compare equal, False otherwise.
>>> xr_occ_iter_flags.DONTCARE_COMPLETE == xr_occ_iter_flags.DROP_LIBMODEL_DEFS
False
__ge__(b)

Greater-than-or-equal operator for xr_occ_iter_flags .

Parameters:b (xr_occ_iter_flags) – The xr_occ_iter_flags object to compare against.
Return type:bool
Returns:True if self >= b , False otherwise.
>>> xr_occ_iter_flags.NONE >= xr_occ_iter_flags.DONTCARE_COMPLETE
False
__gt__(b)

Greater-than operator for xr_occ_iter_flags .

Parameters:b (xr_occ_iter_flags) – The xr_occ_iter_flags object to compare against.
Return type:bool
Returns:True if self > b , False otherwise.
>>> xr_occ_iter_flags.DONTCARE_COMPLETE > xr_occ_iter_flags.NONE
True
__hash__()

Hash function for xr_occ_iter_flags .

Return type:int
>>> hash(xr_occ_iter_flags.DROP_LIBMODEL_DEFS)
1
__invert__()

Complementation operator.

Return type:xr_occ_iter_flags
Returns:A xr_occ_iter_flags object containing the flags that are NOT contained in self.
>>> ~xr_occ_iter_flags.DONTCARE_COMPLETE
<cs.xr_occ_iter_flags drop_libmodel_defs|drop_libmodel_occs|dontcare_def_or_complete|populate_counters>
__le__(b)

Less-than-or-equal operator for xr_occ_iter_flags .

Parameters:b (xr_occ_iter_flags) – The xr_occ_iter_flags object to compare against.
Return type:bool
Returns:True if self <= b , False otherwise.
>>> xr_occ_iter_flags.DROP_LIBMODEL_DEFS <= xr_occ_iter_flags.DONTCARE_COMPLETE
True
__lt__(b)

Less-than operator for xr_occ_iter_flags .

Parameters:b (xr_occ_iter_flags) – The xr_occ_iter_flags object to compare against.
Return type:bool
Returns:True if self < b , False otherwise.
>>> xr_occ_iter_flags.NONE < xr_occ_iter_flags.DROP_LIBMODEL_OCCS
True
__ne__(b)

Inequality operator for xr_occ_iter_flags .

Parameters:b (xr_occ_iter_flags) – The xr_occ_iter_flags object to compare against.
Return type:bool
Returns:False if self and b compare equal, True otherwise.
>>> xr_occ_iter_flags.NONE != xr_occ_iter_flags.DROP_LIBMODEL_OCCS
True
__or__(b)

OR operator for xr_occ_iter_flags .

Parameters:b (xr_occ_iter_flags) – OR operand.
Return type:xr_occ_iter_flags
Returns:A xr_occ_iter_flags object containing all flags that are in at least one of self, b.
>>> xr_occ_iter_flags.DROP_LIBMODEL_OCCS | xr_occ_iter_flags.NONE
<cs.xr_occ_iter_flags drop_libmodel_occs>
__repr__()

Get a representation of a xr_occ_iter_flags object that includes information useful for debugging.

Return type:str
Returns:The string representation.
>>> repr(xr_occ_iter_flags.NONE)
'<cs.xr_occ_iter_flags none>'
__str__()

Get a simple string representation of a xr_occ_iter_flags object.

Return type:str
Returns:The string representation.
>>> str(xr_occ_iter_flags.DROP_LIBMODEL_DEFS)
'drop_libmodel_defs'
as_integer()

Get an integer representation of self.

Return type:int
Returns:An integer suitable for use with xr_occ_iter_flags.from_integer().

Invariant: For xr_occ_iter_flags x, xr_occ_iter_flags.from_integer(x.as_integer()) == x

>>> xoi = (xr_occ_iter_flags.POPULATE_COUNTERS | xr_occ_iter_flags.DONTCARE_COMPLETE).as_integer()
>>> xoi
20
>>> xr_occ_iter_flags.from_integer(xoi)
<cs.xr_occ_iter_flags dontcare_complete|populate_counters>
name()

Get the name of a xr_occ_iter_flags object.

Return type:str
>>> xr_occ_iter_flags.DROP_LIBMODEL_DEFS.name()
'drop_libmodel_defs'
DONTCARE_COMPLETE

Singleton set containing the “don’t care about completeness” flag: if two tuples differ only in completeness, only one of the two will be returned.

>>> xr_occ_iter_flags.DONTCARE_COMPLETE
<cs.xr_occ_iter_flags dontcare_complete>
DONTCARE_DEF_OR_COMPLETE

Set containing the “don’t care about definition location or completeness” flags: if two tuples differ only in completeness and/or definition location, only one of the two will be returned.

>>> xr_occ_iter_flags.DONTCARE_DEF_OR_COMPLETE
<cs.xr_occ_iter_flags dontcare_complete|dontcare_def_or_complete>
DROP_LIBMODEL_DEFS

Singleton set containing the “drop library model definitions” flag: if an occurrence’s associated definition is in a library model, don’t include the occurrence in the iteration.

>>> xr_occ_iter_flags.DROP_LIBMODEL_DEFS
<cs.xr_occ_iter_flags drop_libmodel_defs>
DROP_LIBMODEL_OCCS

Singleton set containing the “drop library model occurrences” flag: if an occurrence is in a library model, don’t include it in the iteration.

>>> xr_occ_iter_flags.DROP_LIBMODEL_OCCS
<cs.xr_occ_iter_flags drop_libmodel_occs>
NONE

Empty set: contains no flags.

>>> xr_occ_iter_flags.NONE
<cs.xr_occ_iter_flags none>
POPULATE_COUNTERS

Compute and store tuple counts for later retrieval by xr_occurrence_iterator or xr_homonym_iterator get_*() functions.

The following are only available when this flag is specified.

>>> xr_occ_iter_flags.POPULATE_COUNTERS
<cs.xr_occ_iter_flags populate_counters>