зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1547730 - Define __hash__ for SandboxDependsFunction and CombinedDependsFunction so we can reference it as a dictionary key in py3 r=#build
Differential Revision: https://phabricator.services.mozilla.com/D28111 --HG-- extra : rebase_source : 7d000f29bc3223e778364e16b4ef0d11c646b8f3 extra : intermediate-source : 5848c6841aa71187fb726172b4bbe2553ba87efc extra : source : 1b31ed5f96344e5f794b4aee6aa8edda4aa3bf2d
This commit is contained in:
Родитель
d6720a8be2
Коммит
23eb9233a8
|
@ -78,6 +78,9 @@ class SandboxDependsFunction(object):
|
|||
def __eq__(self, other):
|
||||
raise ConfigureError('Cannot compare @depends functions.')
|
||||
|
||||
def __hash__(self):
|
||||
return object.__hash__(self)
|
||||
|
||||
def __ne__(self, other):
|
||||
raise ConfigureError('Cannot compare @depends functions.')
|
||||
|
||||
|
@ -232,6 +235,9 @@ class CombinedDependsFunction(DependsFunction):
|
|||
self._func is other._func and
|
||||
set(self.dependencies) == set(other.dependencies))
|
||||
|
||||
def __hash__(self):
|
||||
return object.__hash__(self)
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self == other
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче