Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15287 - main/trunk/pym/portage/cache
Date: Sat, 30 Jan 2010 14:13:45
Message-Id: E1NbE50-0001gE-P2@stork.gentoo.org
1 Author: zmedico
2 Date: 2010-01-30 14:13:42 +0000 (Sat, 30 Jan 2010)
3 New Revision: 15287
4
5 Modified:
6 main/trunk/pym/portage/cache/mappings.py
7 Log:
8 Define __slots__ in all classes.
9
10
11 Modified: main/trunk/pym/portage/cache/mappings.py
12 ===================================================================
13 --- main/trunk/pym/portage/cache/mappings.py 2010-01-30 14:11:13 UTC (rev 15286)
14 +++ main/trunk/pym/portage/cache/mappings.py 2010-01-30 14:13:42 UTC (rev 15287)
15 @@ -22,6 +22,8 @@
16 for UserDict.DictMixin so that code converted via 2to3 will run.
17 """
18
19 + __slots__ = ()
20 +
21 def __iter__(self):
22 return iter(self.keys())
23
24 @@ -79,6 +81,8 @@
25 A mutable vesion of the Mapping class.
26 """
27
28 + __slots__ = ()
29 +
30 def clear(self):
31 for key in list(self):
32 del self[key]
33 @@ -146,6 +150,8 @@
34 http://bugs.python.org/issue2876
35 """
36
37 + __slots__ = ('data',)
38 +
39 def __init__(self, *args, **kwargs):
40
41 self.data = {}
42 @@ -190,6 +196,8 @@
43
44 class OrderedDict(UserDict):
45
46 + __slots__ = ('_order',)
47 +
48 def __init__(self, *args, **kwargs):
49 self._order = []
50 UserDict.__init__(self, *args, **kwargs)