-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take previous config platform_map into account.
- Loading branch information
Showing
5 changed files
with
59 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
dot_image_format = ArchDependent({ | ||
"IMPOSSIBLE_ARCH": "hello", | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
|
||
class HashableDict(dict): | ||
""" | ||
Hashable dict (immutable by definition) | ||
""" | ||
|
||
def __init__(self, other=None): | ||
super(HashableDict, self).__init__() | ||
if other: | ||
for k, v in other.items(): | ||
if isinstance(v, dict): | ||
self[k] = HashableDict(v) | ||
else: | ||
self[k] = v | ||
|
||
def __key(self): | ||
return tuple((k,self[k]) for k in sorted(self)) | ||
|
||
def __hash__(self): | ||
return hash(self.__key()) | ||
|
||
def __eq__(self, other): | ||
return self.__key() == other.__key() | ||
|
||
|