|
|
@ -27,6 +27,14 @@ from functools import lru_cache #https://docs.python.org/3.4/library/functools.h |
|
|
|
cache_unlimited = lru_cache(maxsize=None) |
|
|
|
#use as @cache_unlimited decorator |
|
|
|
|
|
|
|
def dictdiff(a, b): |
|
|
|
"""We use dicts for internal export packages. Compare two of them for changes""" |
|
|
|
result = {} |
|
|
|
for key, value in a.items(): |
|
|
|
if not b[key] == value: |
|
|
|
result[key] = (value, b[key]) |
|
|
|
return result |
|
|
|
|
|
|
|
import itertools |
|
|
|
def pairwise(iterable): |
|
|
|
"s -> (s0,s1), (s1,s2), (s2, s3), ..." |
|
|
|