Add docstring to slot_dict_class().
authorZac Medico <zmedico@gentoo.org>
Wed, 25 Jun 2008 22:49:32 +0000 (22:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 25 Jun 2008 22:49:32 +0000 (22:49 -0000)
svn path=/main/trunk/; revision=10794

pym/portage/cache/mappings.py

index 118592597055556ac191a4d52b647caee36962a5..c09760fb06dc732107bd61d450d1fcfb08173137 100644 (file)
@@ -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: