The base class containing common functionality for all subclasses
representing various network address types.
It is a fully functioning class (as opposed to a virtual class) with a
heuristic constructor that detects the type of address via the first
argument if it is a string and sets itself up accordingly. If the first
argument is an integer, then a constant must be provided via the second
argument indicating the address type explicitly.
Objects of this class behave differently dependent upon the type of
address they represent.
|
|
|
|
|
|
|
|
|
|
|
|
|
bits(self)
Returns:
human-readable binary digit string of this address |
source code
|
|
|
|
|
bin(self)
Returns:
standard Python binary representation of this address. |
source code
|
|
|
|
|
|
|
__getitem__(self,
index)
Returns:
The integer value of the word referenced by index (both positive and
negative). |
source code
|
|
|
__setitem__(self,
index,
value)
Sets the value of the word referenced by index in this address |
source code
|
|
|
|
|
|
|
|
|
__add__(self,
other)
Returns:
A new (potentially larger) Addr class/subclass instance. |
source code
|
|
|
__sub__(self,
other)
Returns:
A new (potentially smaller) Addr class/subclass instance. |
source code
|
|
|
__eq__(self,
other)
Returns:
True if this address is numerically the same as other,
False otherwise. |
source code
|
|
|
__ne__(self,
other)
Returns:
True if this address is not numerically the same other,
False otherwise. |
source code
|
|
|
__lt__(self,
other)
Returns:
True if this address is numerically lower in value than
other, False otherwise. |
source code
|
|
|
__le__(self,
other)
Returns:
True if this address is numerically lower or equal in
value to other, False otherwise. |
source code
|
|
|
__gt__(self,
other)
Returns:
True if this address is numerically greater in value
than other, False otherwise. |
source code
|
|
|
__ge__(self,
other)
Returns:
True if this address is numerically greater or equal in
value to other, False otherwise. |
source code
|
|
|
__or__(self,
other)
Returns:
bitwise OR (x | y) of self.value with other.value. |
source code
|
|
|
__and__(self,
other)
Returns:
bitwise AND (x & y) of self.value with other.value. |
source code
|
|
|
__xor__(self,
other)
Returns:
bitwise exclusive OR (x ^ y) of self.value with other.value. |
source code
|
|
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__
|
|
STRATEGIES = ( IPv4StrategyOpt(32, 8, '.', 4, 10, False), IPv6S...
|
|
ADDR_TYPES = ( 0, 4, 6, 48, 64)
|
|
value = AddrValueDescriptor('value')
|
|
strategy = StrategyDescriptor(STRATEGIES)
|
|
addr_type = AddrTypeDescriptor(ADDR_TYPES)
|