Define __slots__ for classes derived from ObjectProxy.
authorZac Medico <zmedico@gentoo.org>
Fri, 6 Mar 2009 05:04:21 +0000 (05:04 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 6 Mar 2009 05:04:21 +0000 (05:04 -0000)
svn path=/main/trunk/; revision=12769

pym/portage/__init__.py

index fb6cfaf5f55ab276d34bdf198eb82b802d18e785..83acb0fedd37c750ac1c15e70aa14960703b19ec 100644 (file)
@@ -7933,6 +7933,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)
@@ -7949,6 +7952,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
@@ -7962,6 +7967,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)