-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes in Config.py are only reordering things
- Loading branch information
Showing
5 changed files
with
80 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -545,9 +545,11 @@ def __init__(self, operand): | |
raise RuntimeError("This operator cannot accept a non sequenceable type") | ||
def __eq__(self, other): | ||
# allows replace(~a, b) | ||
return isinstance(self, type(other)) and self._operand==other._operand | ||
return type(self) is type(other) and self._operand==other._operand | ||
def __ne__(self, other): | ||
return not self.__eq__(other) | ||
def __hash__(self): | ||
return hash((type(self), self._operand)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Dr15Jones
Contributor
|
||
def _findDependencies(self,knownDeps, presentDeps): | ||
self._operand._findDependencies(knownDeps, presentDeps) | ||
def _clonesequence(self, lookuptable): | ||
|
Oops, something went wrong.
Unfortunately, (after some googling) this is flawed. Because the class type is mutable (ie. self.operand can be changed by call to
_replace
) the hash can change over the lifetime of the object. But hashes are not allowed to be changed since they are evaluted once when inserted in a container.https://eng.lyft.com/hashing-and-equality-in-python-2ea8c738fb9d
I'm not sure what to do at the moment.