Package pytilities :: Module attributecollectionbase :: Class AttributeCollectionBase
[hide private]
[frames] | no frames]

Class AttributeCollectionBase

source code

object --+
         |
        AttributeCollectionBase
Known Subclasses:


Mixin, allows extension of instance attributes with `AttributeCollection`s

This mixin allows a class' instances' attributes and set of supported
operators to be extended with `AttributeCollection`s.

Note: this class provides a base for using `AttributeCollection`s, it is not
a base class of `AttributeCollection`. This have been a misnomer.

Methods:

    - `_append_attribute_collection`: Append a new `AttributeCollection`
    
Class invariants:

    1. an `AttributeCollectionBase` never contains two identical
    `AttributeCollection`s

Instance Methods [hide private]
 
__abs__(self) source code
 
__add__(self, other) source code
 
__copy__(self) source code
 
__delattr__(self, name)
x.__delattr__('name') <==> del x.name
source code
 
__div__(self, other) source code
 
__eq__(self, other) source code
 
__floordiv__(self, other) source code
 
__getattr__(self, name) source code
 
__getitem__(self, key) source code
 
__iadd__(self, other) source code
 
__imul__(self, other) source code
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__iter__(self) source code
 
__len__(self) source code
 
__mul__(self, other) source code
 
__neg__(self) source code
 
__neq__(self, other) source code
 
__nonzero__(self) source code
 
__pos__(self) source code
 
__rdiv__(self, other) source code
 
__rfloordiv__(self, other) source code
 
__rmul__(self, other) source code
 
__rtruediv__(self, other) source code
 
__setattr__(self, name, value)
x.__setattr__('name', value) <==> x.name = value
source code
 
__setitem__(self, key, value) source code
 
__str__(self)
str(x)
source code
 
__sub__(self, other) source code
 
__truediv__(self, other) source code
 
_append_attribute_collection(self, collection)
Append a new `AttributeCollection`.
source code

Inherited from object: __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__delattr__(self, name)

source code 

x.__delattr__('name') <==> del x.name

Overrides: object.__delattr__
(inherited documentation)

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__setattr__(self, name, value)

source code 

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

_append_attribute_collection(self, collection)

source code 

Append a new `AttributeCollection`.

When attributes of collections overlap, the first of overlapping
attributes found in the lookup process is used and the others are
ignored. Lookup happens in the same order as collections were added. (It
is probably best to avoid overlaps.)

Parameters:

    collection :: AttributeCollection
        the collection to add