Define __slots__ for classes derived from ObjectProxy. (trunk r12769)
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 06:45:10 +0000 (06:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 06:45:10 +0000 (06:45 -0000)
svn path=/main/branches/2.1.6/; revision=13013

pym/portage/__init__.py

index 109d82af83c24911aa6c124646de4abea225545e..7a3a9f2709e633e8f3f8c92e31fad61987ace7ae 100644 (file)
@@ -7920,6 +7920,9 @@ class _LegacyGlobalProxy(proxy.objectproxy.ObjectProxy):
        Instances of these serve as proxies to global variables
        that are initialized on demand.
        """
+
+       __slots__ = ('_name',)
+
        def __init__(self, name):
                proxy.objectproxy.ObjectProxy.__init__(self)
                object.__setattr__(self, '_name', name)
@@ -7936,6 +7939,8 @@ class _PortdbProxy(proxy.objectproxy.ObjectProxy):
        are needed while the portdb is not.
        """
 
+       __slots__ = ()
+
        def _get_target(self):
                init_legacy_globals()
                global db, portdb, root, _portdb_initialized
@@ -7949,6 +7954,8 @@ class _MtimedbProxy(proxy.objectproxy.ObjectProxy):
        The mtimedb is independent from the portdb and other globals.
        """
 
+       __slots__ = ('_name',)
+
        def __init__(self, name):
                proxy.objectproxy.ObjectProxy.__init__(self)
                object.__setattr__(self, '_name', name)