wip
This commit is contained in:
parent
5a1ca9142d
commit
77ed1970e1
2 changed files with 8 additions and 9 deletions
|
@ -1,13 +1,5 @@
|
||||||
class hdict(dict):
|
|
||||||
def __hash__(self):
|
|
||||||
return hash(tuple(sorted(self.items())))
|
|
||||||
|
|
||||||
class hlist(list):
|
|
||||||
def __hash__(self):
|
|
||||||
return hash(tuple(sorted(self)))
|
|
||||||
|
|
||||||
|
|
||||||
from ipaddress import ip_interface
|
from ipaddress import ip_interface
|
||||||
|
hdict, hlist = repo.libs.hashable.hdict, repo.libs.hashable.hlist
|
||||||
|
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
|
|
7
libs/hashable.py
Normal file
7
libs/hashable.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
class hdict(dict):
|
||||||
|
def __hash__(self):
|
||||||
|
return hash(tuple(sorted(self.items())))
|
||||||
|
|
||||||
|
class hlist(list):
|
||||||
|
def __hash__(self):
|
||||||
|
return hash(tuple(sorted(self)))
|
Loading…
Reference in a new issue