Package pytilities :: Module attributecollection :: Class AttributeCollection
[hide private]
[frames] | no frames]

Class AttributeCollection

source code

object --+
         |
        AttributeCollection
Known Subclasses:


Abstract, represents a collection of attributes.

Attribute collections can represent infinite amounts of attributes,
generate them at request, ...

Methods:

    - `getattr_`: Try to get the value of an attribute
    - `setattr_`: Try to set the value of an attribute
    - `delattr_`: Try to delete an attribute

Instance Methods [hide private]
 
delattr_(self, name)
Try to delete an attribute
source code
 
getattr_(self, name)
Try to get the value of an attribute
source code
 
setattr_(self, name, value)
Try to set the value of an attribute
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

delattr_(self, name)

source code 

Try to delete an attribute

Parameters:

    `name` :: string
        name of the attribute to delete

Returns True, if the attribute was found, False otherwise

getattr_(self, name)

source code 

Try to get the value of an attribute

Parameters:

    `name` :: string
        name of the attribute to get

Returns whether the attribute was found, and if so, its value
:: (found_attribute::bool, value)

setattr_(self, name, value)

source code 

Try to set the value of an attribute

Parameters:

    `name` :: string
        name of the attribute to set

    `value`
        the new value
            
Returns True, if the attribute was found, False otherwise