BoundAttribute

This is a declarative class that passes all the values given to it to another object. So you can pass it arguments (via __init__/__call__) or give it the equivalent of keyword arguments through subclassing. Then a bound object will be added in its place.

To hook this other object in, override make_object(added_class, name, **attrs) and maybe set_object(added_class, name, **attrs) (the default implementation of set_object just resets the attribute to whatever make_object returned).

Also see BoundFactory.


Attributes

a clone_for_subclass

True

a __unpackargs__

()

a __addtoclass__

<bound class method BoundAttribute.__addtoclass__>

a singleton

<bound class method BoundAttribute.singleton>

a __mutableattributes__

()

a __restrict_attributes__

None

a declarative_count

1

Methods

f __subclasshook__(...) ...

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

f __format__(...) ...

default object formatter

f __sizeof__(...) ...

__sizeof__() -> int size of object in memory, in bytes

f __classinit__(cls, new_attrs) ...

f __instanceinit__(self, new_attrs) ...

f set_object(cls, added_class, attr_name, obj) ...

f make_object(cls, added_class, attr_name, *args, **attrs) ...

f __init__(self, *args, **kw) ...

f __call__(self, *args, **kw) ...

See the source for more information.