pkgcore.package.base module¶
base package class; instances should derive from this.
Right now, doesn’t provide much, need to change that down the line
- class pkgcore.package.base.DynamicGetattrSetter(name, bases, class_dict)[source]¶
Bases:
type
Metaclass utilizing __getattr__ to JIT generate attributes and store them.
Consider snakeoil.klass.jit_attr for comparison; that pseudo property will invoke a functor and store the result, but every subsequent access- still pays overhead of passing through the redirects.
This metaclass lacks that overhead; via hooking __getattr__, this generates the requested attribute, stores it on the instance, and returns it. All future access of that attribute go through the fast path cpy access ways.
This optimization in the early days of pkgcore had drastic impact; in modern times python has improved. There still is gain, but the implementation complexity may warrant phasing this out in favor of snakeoil.klas.jit_attr alternatives.
- class pkgcore.package.base.base[source]¶
Bases:
SlotsPicklingMixin
- built = False¶
- configurable = False¶
- property is_supported¶
- property unversioned_atom¶
- property versioned_atom¶