diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-06-25 22:49:32 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-06-25 22:49:32 +0000 |
commit | 1eb3edfc4581ada94619749546f8b83ae61e0d4a (patch) | |
tree | dea51ebd0c25ef5f863904f830db9c4c325d62bd | |
parent | acf72358d4a7fef221683eececc1f89395d4d739 (diff) | |
download | portage-1eb3edfc4581ada94619749546f8b83ae61e0d4a.tar.gz portage-1eb3edfc4581ada94619749546f8b83ae61e0d4a.tar.bz2 portage-1eb3edfc4581ada94619749546f8b83ae61e0d4a.zip |
Add docstring to slot_dict_class().
svn path=/main/trunk/; revision=10794
-rw-r--r-- | pym/portage/cache/mappings.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pym/portage/cache/mappings.py b/pym/portage/cache/mappings.py index 118592597..c09760fb0 100644 --- a/pym/portage/cache/mappings.py +++ b/pym/portage/cache/mappings.py @@ -105,6 +105,17 @@ class LazyLoad(UserDict.DictMixin): _slot_dict_classes = weakref.WeakValueDictionary() def slot_dict_class(keys): + """ + 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. + + @param keys: Fixed set of allowed keys + @type keys: iterable + @rtype: SlotDict + @returns: A class that constructs SlotDict instances + having the specified keys. + """ if isinstance(keys, frozenset): keys_set = keys else: |