class documentation

class Item:

View In Hierarchy

An item of an Enumeration.

Method __eq__ Compares the instance for equality with an object.
Method __hash__ Returns the hash for this value.
Method __init__ Initializes a new item from its name and value.
Method __ne__ Compares the instance for equality with an object.
Method __str__ Returns the nicely printable string representation of this instance.
Property name The name of the item in the Enumeration.
Property value The value of the item in the Enumeration.
Instance Variable _name Undocumented
Instance Variable _value Undocumented
def __eq__(self, o):

Compares the instance for equality with an object.

  • if the object is not an Item, it will never be equal to this instance.
  • otherwise, all Items with the same name and value are considered equal.

Warning

Since the parent enumeration is not taken into account when comparing items for equality, two items with the same name and value will compare equal even if they are from different enumerations.

Parameters
o:objectUndocumented
Returns
boolUndocumented
def __hash__(self):

Returns the hash for this value.

Returns
intUndocumented
def __init__(self, name, value):

Initializes a new item from its name and value.

Parameters
name:strUndocumented
value:intUndocumented
def __ne__(self, o):

Compares the instance for equality with an object.

  • if the object is not an Item, it will never be equal to this instance.
  • otherwise, all Items with the same name and value are considered equal.

Warning

Since the parent enumeration is not taken into account when comparing items for equality, two items with the same name and value will compare equal even if they are from different enumerations.

Parameters
o:objectUndocumented
Returns
boolUndocumented
def __str__(self):

Returns the nicely printable string representation of this instance.

Returns
strUndocumented
@property
name: str =

The name of the item in the Enumeration.

@property
value: int =

The value of the item in the Enumeration.

_name =

Undocumented

_value =

Undocumented