Automatic delegation through descriptors


Version: 1.0
Category:
Scripts
Python
Requirements:
Seller:
Price:
-
System:
Rating:
4.4
License:

Description - Automatic delegation through descriptors



When you want a class instance to act as if it was an instance of another class (at least from some Aspect), but for some reason you can`t use multiple inheritance, You have to deal with some kind of "delegation": You embed an object of the other instance as an attribute of your main instance, and then Create as much attributes as you can that "point to" corresponding attribute of the embedded instance. To avoid all that coding stuff, here`s a function, "immerse", that automatically sets as class properties all attributes that an instance of another class have, and that are not in the main class.



More in Python-Automatic delegation through descriptors

Attributes Attribute Delegation Through