Module content
source code
I define class Content and a mixin class WithContentMixin for all
types of elements that can have a content.
Note that Content instances are just place-holders for content-related
attributes and methods. They do not store data about the content, the
data is stored in the element owning the content, thanks to
WithContentMixin. This makes their on-demand-generation relatively cheap
(no data retrieving).
Note also attributes/methods of the form e.content.X are also
accessible under the form e.content_X, which might be slightly more
efficient (less lookup). Maybe the former should be eventually
deprecated...