class procedure_kind

Enumeration class: the “kind” of a procedure .

The procedure_kind class corresponds to the PDG kind abstraction.

procedure_kind Details

class cs.procedure_kind

Enumeration class: the “kind” of a procedure .

static from_integer(_inner)

Construct an instance from an integer representation.

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

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

>>> pk = procedure_kind.LIBRARY.as_integer()
>>> pk
3
>>> procedure_kind.from_integer(pk)
<cs.procedure_kind library>
__cmp__(other)

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

Parameters:other (procedure_kind) – The procedure_kind 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
>>> procedure_kind.UNDEFINED.__cmp__(procedure_kind.SYSTEM_INITIALIZATION)
-1
__eq__(b)

Equality operator for procedure_kind .

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

Greater-than-or-equal operator for procedure_kind .

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

Greater-than operator for procedure_kind .

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

Hash function for procedure_kind .

Return type:int
>>> hash(procedure_kind.FILE_INITIALIZATION)
5
__le__(b)

Less-than-or-equal operator for procedure_kind .

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

Less-than operator for procedure_kind .

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

Inequality operator for procedure_kind .

Parameters:b (procedure_kind) – The procedure_kind object to compare against.
Return type:bool
Returns:False if self and b compare equal, True otherwise.
>>> procedure_kind.HAMMOCK_GENERATED != procedure_kind.GENERATED_INDIRECT
True
__repr__()

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

Return type:str
Returns:The string representation.
>>> repr(procedure_kind.USER_DEFINED)
'<cs.procedure_kind user-defined>'
__str__()

Get a simple string representation of a procedure_kind object.

Return type:str
Returns:The string representation.
>>> str(procedure_kind.SYSTEM_INITIALIZATION)
'system-initialization'
as_integer()

Get an integer representation of self.

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

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

>>> pk = procedure_kind.LIBRARY.as_integer()
>>> pk
3
>>> procedure_kind.from_integer(pk)
<cs.procedure_kind library>
name()

Get the name of a procedure_kind object.

Return type:str
Returns:The name.
>>> procedure_kind.LIBRARY.name()
'library'
FILE_INITIALIZATION

Kind file-initialization

>>> procedure_kind.FILE_INITIALIZATION
<cs.procedure_kind file-initialization>
GENERATED_INDIRECT

Kind generated-indirect

>>> procedure_kind.GENERATED_INDIRECT
<cs.procedure_kind generated-indirect>
HAMMOCK_GENERATED

For internal use only.

>>> procedure_kind.HAMMOCK_GENERATED
<cs.procedure_kind hammock-generated>
LIBRARY

Kind library

>>> procedure_kind.LIBRARY
<cs.procedure_kind library>
SYSTEM_INITIALIZATION

Kind system-initialization

>>> procedure_kind.SYSTEM_INITIALIZATION
<cs.procedure_kind system-initialization>
UNDEFINED

Kind undefined

>>> procedure_kind.UNDEFINED
<cs.procedure_kind undefined>
USER_DEFINED

Kind user-defined

>>> procedure_kind.USER_DEFINED
<cs.procedure_kind user-defined>