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 register(functor)[source]

Bases: object

Decorator used to mark a function as an attribute loader.

functor
class pkgcore.package.base.base[source]

Bases: SlotsPicklingMixin

built = False
configurable = False
property is_supported
operations(domain, **kwds)[source]
property unversioned_atom
property versioned_atom
pkgcore.package.base.dynamic_getattr_dict(self, attr)[source]
class pkgcore.package.base.wrapper(raw_pkg)[source]

Bases: base

property built

alias to _raw_pkg.built

property is_supported

alias to _raw_pkg.is_supported

operations(domain, **kwds)[source]
property unversioned_atom

alias to _raw_pkg.unversioned_atom

property versioned_atom

alias to _raw_pkg.versioned_atom