summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-01-30 14:13:42 +0000
committerZac Medico <zmedico@gentoo.org>2010-01-30 14:13:42 +0000
commite79df2d43ccb5f5ea8a63a8b58797e863fbdd21d (patch)
tree9b8154f8ad8bfc665f0393af0021e66d4d776f2b
parente38112ef95720a3c71fdc09b68493c810c22443f (diff)
downloadportage-e79df2d43ccb5f5ea8a63a8b58797e863fbdd21d.tar.gz
portage-e79df2d43ccb5f5ea8a63a8b58797e863fbdd21d.tar.bz2
portage-e79df2d43ccb5f5ea8a63a8b58797e863fbdd21d.zip
Define __slots__ in all classes.
svn path=/main/trunk/; revision=15287
-rw-r--r--pym/portage/cache/mappings.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pym/portage/cache/mappings.py b/pym/portage/cache/mappings.py
index 2e24a7a8a..f15f362b0 100644
--- a/pym/portage/cache/mappings.py
+++ b/pym/portage/cache/mappings.py
@@ -22,6 +22,8 @@ class Mapping(object):
for UserDict.DictMixin so that code converted via 2to3 will run.
"""
+ __slots__ = ()
+
def __iter__(self):
return iter(self.keys())
@@ -79,6 +81,8 @@ class MutableMapping(Mapping):
A mutable vesion of the Mapping class.
"""
+ __slots__ = ()
+
def clear(self):
for key in list(self):
del self[key]
@@ -146,6 +150,8 @@ class UserDict(MutableMapping):
http://bugs.python.org/issue2876
"""
+ __slots__ = ('data',)
+
def __init__(self, *args, **kwargs):
self.data = {}
@@ -190,6 +196,8 @@ class UserDict(MutableMapping):
class OrderedDict(UserDict):
+ __slots__ = ('_order',)
+
def __init__(self, *args, **kwargs):
self._order = []
UserDict.__init__(self, *args, **kwargs)