netaddr.ip.IPListMixin

Package netaddr :: Package ip :: Class IPListMixin |
[hide private]
[frames] | no frames]

# Class IPListMixin

    object --+
             |
            IPListMixin

Known Subclasses:
  - IPRange
  - , IPNetwork

A mixin class providing shared list-like functionality to classes representing groups of IP addresses.

Instance Methods | [hide private]
__iter__(self) Returns: An iterator providing access to all IPAddress objects within range represented by this ranged IP object. |
__len__(self) Returns: the number of IP addresses in this ranged IP object. |
__getitem__(self, index) Returns: The IP address(es) in this IPNetwork object referenced by index or slice. |
__contains__(self, other) Returns: `True` if other falls within the boundary of this one, `False` otherwise. |
__nonzero__(self) Ranged IP objects always represent a sequence of at least one IP address and are therefore always True in the boolean context. |
__bool__(self) Ranged IP objects always represent a sequence of at least one IP address and are therefore always True in the boolean context. |
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__init__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]
| size The total number of IP addresses within this ranged IP object.
Inherited from `object`: `__class__`

Method Details | [hide private]

### __iter__(self) |
Returns: An iterator providing access to all IPAddress objects within range represented by this ranged IP object.

### __len__(self) (Length operator) |
Returns: the number of IP addresses in this ranged IP object. Raises an `IndexError` if size > system max int (a Python 2.x limitation). Use the .size property for subnets of any size.

### __getitem__(self, index) (Indexing operator) |
Returns: The IP address(es) in this IPNetwork object referenced by index or slice. As slicing can produce large sequences of objects an iterator is returned instead of the more usual `list`.

### __contains__(self, other) (In operator) |
Parameters: `other` - an IPAddress or ranged IP object. Returns: `True` if other falls within the boundary of this one, `False` otherwise.

Property Details | [hide private]

### size The total number of IP addresses within this ranged IP object. Get Method: unreachable.size(self) - The total number of IP addresses within this ranged IP object.