Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10794 - main/trunk/pym/portage/cache
Date: Wed, 25 Jun 2008 22:49:40
Message-Id: E1KBdnx-0004PU-Hf@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-06-25 22:49:32 +0000 (Wed, 25 Jun 2008)
3 New Revision: 10794
4
5 Modified:
6 main/trunk/pym/portage/cache/mappings.py
7 Log:
8 Add docstring to slot_dict_class().
9
10
11 Modified: main/trunk/pym/portage/cache/mappings.py
12 ===================================================================
13 --- main/trunk/pym/portage/cache/mappings.py 2008-06-25 22:39:42 UTC (rev 10793)
14 +++ main/trunk/pym/portage/cache/mappings.py 2008-06-25 22:49:32 UTC (rev 10794)
15 @@ -105,6 +105,17 @@
16 _slot_dict_classes = weakref.WeakValueDictionary()
17
18 def slot_dict_class(keys):
19 + """
20 + Generates mapping classes that behave similar to a dict but store values
21 + as object attributes that are allocated via __slots__. Instances of these
22 + objects have a smaller memory footprint than a normal dict object.
23 +
24 + @param keys: Fixed set of allowed keys
25 + @type keys: iterable
26 + @rtype: SlotDict
27 + @returns: A class that constructs SlotDict instances
28 + having the specified keys.
29 + """
30 if isinstance(keys, frozenset):
31 keys_set = keys
32 else:
33
34 --
35 gentoo-commits@l.g.o mailing list