Home | Trees | Indices | Help |
|
---|
|
object --+ | type --+ | sip.wrappertype --+ | gui.undoable_alignment.ProteinAlignment.__metaclass__
This metaclass makes it easy to create a class that wraps another one.
In general, if class A wraps class B, then:
* Every static method, class method, and property on B is accessible from A, unless A already has attributes with the same name defined
* Every method on B decorated by @const will be available from A, unless A already has attributes with the same name defined
* Every instance attribute on B named in instance_attrs will be available from A.
This may sound like a clumsy reinvention of classical inheritance. But it can be useful to use a wrapper when we want the wrapped class to be able to call any of its own methods without any danger of the wrapper methods being called, while at the same time ensuring that we can conveniently provide the same interface from the wrapped class. For example, we have a ProteinAlignment class that encapsulates operations on structured collections of protein sequences. We use this metaclass to create an undoable ProteinAlignment that presents an identical interface but that can safely perform redo and undo operations by manipulating the protein alignment it wraps.
|
|||
Inherited from Inherited from Inherited from |
|
|||
|
|||
|
|||
property |
|
||
bool |
|
|
|||
a new object with type S, a subtype of T |
|
|
|||
Inherited from |
|
|
Copies the doc string from the wrapped to the wrapper, if appropriate We only copy the doc string if both attributes are methods and copying a doc string wouldn't overwrite one already present on the wrapper. |
Returns a method that delegates method calls to the wrapped instance
|
Returns a property that delegates property access to the wrapped instance
|
Given an attribute on the wrapped class indicates whether it should be wrapped
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Aug 8 02:53:04 2017 | http://epydoc.sourceforge.net |