Gentoo Archives: gentoo-commits

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