Package portage :: Package cache :: Module mappings
[hide private]

Module mappings

source code

Classes [hide private]
  Mapping
In python-3.0, the UserDict.DictMixin class has been replaced by Mapping and MutableMapping from the collections module, but 2to3 doesn't currently account for this change:
  MutableMapping
A mutable vesion of the Mapping class.
  UserDict
Use this class as a substitute for UserDict.UserDict so that code converted via 2to3 will run:
  OrderedDict
  ProtectedDict
given an initial dict, this wraps that dict storing changes in a secondary dict, protecting the underlying dict from changes
  LazyLoad
Lazy loading of values for a dict
Functions [hide private]
SlotDict
slot_dict_class(keys, prefix='_val_')
Generates mapping classes that behave similar to a dict but store values as object attributes that are allocated via __slots__.
source code
Variables [hide private]
  _slot_dict_classes = <WeakValueDictionary at 141723084>
  __package__ = 'portage.cache'

Imports: sys, weakref


Function Details [hide private]

slot_dict_class(keys, prefix='_val_')

source code 

Generates mapping classes that behave similar to a dict but store values as object attributes that are allocated via __slots__. Instances of these objects have a smaller memory footprint than a normal dict object.

Parameters:
  • keys (Iterable) - Fixed set of allowed keys
  • prefix (String) - a prefix to use when mapping attribute names from keys
Returns: SlotDict
A class that constructs SlotDict instances having the specified keys.