summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-08-24 17:32:19 +0000
committerZac Medico <zmedico@gentoo.org>2008-08-24 17:32:19 +0000
commit12ab9b31ccb72186c55f7021ca836f95a2187a12 (patch)
treeac6b9de7395d1fd7d84f904dcd3c95a4e4fd2ba1 /pym
parent45f577605f78da1ea0c0155a712a22428313f379 (diff)
downloadportage-12ab9b31ccb72186c55f7021ca836f95a2187a12.tar.gz
portage-12ab9b31ccb72186c55f7021ca836f95a2187a12.tar.bz2
portage-12ab9b31ccb72186c55f7021ca836f95a2187a12.zip
* Fix broken _ObjectKey.__eq__() logic from previous commit.
* Define _ObjectKey.__slots__ to save memory. svn path=/main/trunk/; revision=11467
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/vartree.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index b3eefe8c4..598845e0b 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -153,6 +153,8 @@ class LinkageMap(object):
"""Helper class used as _obj_properties keys for objects."""
+ __slots__ = ("__weakref__", "_key")
+
def __init__(self, object):
"""
This takes a path to an object.
@@ -167,9 +169,11 @@ class LinkageMap(object):
return hash(self._key)
def __eq__(self, other):
- if not isinstance(other, self.__class__):
- return False
- return self._key == other._key
+ if isinstance(other, self.__class__):
+ other_key = other._key
+ else:
+ other_key = other
+ return self._key == other_key
def _generate_object_key(self, object):
"""