Package glue :: Package ligolw :: Module _ilwd :: Class ilwdchar
[hide private]
[frames] | no frames]

Class ilwdchar

object --+
         |
        ilwdchar
Known Subclasses:

RAM-efficient row ID parent class. This is only useful when subclassed in order to provide specific values of the class attributes "table_name" and "column_name". The attributes must be unicode objects.

Example:

>>> class ID(ilwdchar):
...     __slots__ = ()
...     table_name = u"table_a"
...     column_name = u"column_b"
... 
>>> x = ID(10)
>>> print(x)
table_a:column_b:10
>>> print(x + 35)
table_a:column_b:45
>>> y = ID(10)
>>> print(x - y)
table_a:column_b:0
>>> x == y
True
>>> x is y
False
>>> len(set([x, y]))
1

Note that the two instances have the same hash value and compare as equal, and so only one of them remains in the set although they are not the same object.

Instance Methods [hide private]
 
__add__(x, y)
x+y
 
__conform__(...)
See http://www.python.org/dev/peps/pep-0246 for more information.
 
__eq__(x, y)
x==y
 
__ge__(x, y)
x>=y
 
__gt__(x, y)
x>y
 
__hash__(x)
hash(x)
 
__int__(x)
int(x)
 
__le__(x, y)
x<=y
 
__lt__(x, y)
x<y
 
__ne__(x, y)
x!=y
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__radd__(x, y)
y+x
 
__rsub__(x, y)
y-x
 
__str__(x)
str(x)
 
__sub__(x, y)
x-y

Inherited from object: __delattr__, __format__, __getattribute__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__hash__(x)
(Hashing function)

 

hash(x)

Overrides: object.__hash__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__str__(x)
(Informal representation operator)

 

str(x)

Overrides: object.__str__