class documentation
class Item:
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
Item
s 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:object | Undocumented |
Returns | |
bool | Undocumented |
def __init__(self, name, value):
Initializes a new item from its name and value.
Parameters | |
name:str | Undocumented |
value:int | Undocumented |
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
Item
s 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:object | Undocumented |
Returns | |
bool | Undocumented |