mdl_features ( self )
All feature objects of this type, in monotonic order
The monotonic order of features is equivalent to the concatenation of
mdl_featuresDefined for all classes in the type's MRO, in
reverse MRO order, with duplicates (i.e. overridden features)
eliminated. That is, if a feature named x exists in more than one
class in the MRO, the most specific definition of x will be used
(i.e. the first definition in MRO order), but it will be placed in the
position reserved by the less specific definition. The idea is
that, once a position has been defined for a feature name, it will
continue to be used by all subclasses, if possible. For example:
class A(model.Type):
class foo(model.Attribute): pass
class B(A):
class foo(model.Attribute): pass
class bar(model.Attribute): pass
would result in B having a mdl_features order of (foo,bar) ,
even though its mdl_featuresDefined would be (bar,foo) (because
features without a sort priority define are ordered by name).
The purpose of using a monotonic ordering like this is that it allows
subtypes to use a serialized format that is a linear extension of
their supertype, at least in the case of single inheritance. It may
also be useful for GUI layouts, where it's also desirable to have a
subtype's display look "the same" as a base type's display, except for
those features that it adds to the supertype.
|