stirInto(cls,
new_cls,
include=None,
exclude=None)
| source code
|
Adds the methods in new_cls named in include or those not in exclude,
or all methods if neither is specified, to cls. After stirring, all
instances of cls will have the new methods. If there is a method name
clash, the method already in cls will be prefixed with an underscore
before the new method of the same name is mixed in.
Based on code from
http://wwwx.cs.unc.edu/~parente/cgi-bin/RuntimeClassMixins.
- Parameters:
cls (class) - Existing class to mix features into
new_cls (class) - Class containing features to add
include (list) - Method names to add
exclude (list) - Method names to avoid adding
|