Commits

Michał Górny committed d4ee345

Paludis: use rich comparisons.

Comments (0)

Files changed (2)

gentoopm/paludispm/pkg.py

 		return PaludisAtom(self._pkg.uniquely_identifying_spec(),
 				self._env, self)
 
-	def __cmp__(self, other):
+	def __lt__(self, other):
 		if not isinstance(other, PaludisID):
 			raise TypeError('Unable to compare %s against %s' % \
 					self, other)
 		if self._enum_id != other._enum_id:
 			raise TypeError('Unable to compare results of two enumerations')
-		return cmp(self._num, other._num)
-
-	def __eq__(self, other):
-		if not isinstance(other, PaludisID):
-			raise TypeError('Unable to compare %s against %s' % \
-					self, other)
-		return self.id == other.id
+		return self._num < other._num
 
 class PaludisMetadata(PMPackageMetadata):
 	def __init__(self, pkg):

gentoopm/paludispm/repo.py

 	def path(self):
 		return self._repo.location_key().parse_value()
 
-	def __eq__(self, other):
-		return self.name == other.name and self.path == other.path
-
 class PaludisInstalledRepo(PaludisRepository):
 	def __init__(self, env):
 		self._env = env