Define __slots__ in all classes. (trunk r15287)
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 19:49:07 +0000 (19:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 19:49:07 +0000 (19:49 -0000)
svn path=/main/branches/2.1.7/; revision=15526

pym/portage/cache/mappings.py

index 2e24a7a8a0a309cf6d5e2bc0fe8e29120b132736..f15f362b0d8608b85c22cae8884172d5be0cb08b 100644 (file)
@@ -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)