diff --git a/bundles/bind/metadata.py b/bundles/bind/metadata.py index 1fc8fc8..f43a285 100644 --- a/bundles/bind/metadata.py +++ b/bundles/bind/metadata.py @@ -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 +hdict, hlist = repo.libs.hashable.hdict, repo.libs.hashable.hlist defaults = { diff --git a/libs/hashable.py b/libs/hashable.py new file mode 100644 index 0000000..5cb4562 --- /dev/null +++ b/libs/hashable.py @@ -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)))