I ran into some problems running checkpy because the following lines failed:
|
key = args + tuple(values) + tuple(sys.argv) |
|
|
|
if key not in localCache: |
It specifically failed when passing a list to a function that is wrapped by this cache.
A tuple is not guaranteed to be hashable, it fails when the tuple contains an unhashable type:
([]) in {} # TypeError: unhashable type: 'list'
Solution: use str() to create hashable versions of any object (with __str___)
Perhaps I'll create a PR sometime :-)
I ran into some problems running
checkpybecause the following lines failed:CheckPy/checkpy/caches.py
Lines 47 to 49 in 67f36f1
It specifically failed when passing a list to a function that is wrapped by this cache.
A
tupleis not guaranteed to be hashable, it fails when thetuplecontains an unhashable type:Solution: use
str()to create hashable versions of any object (with__str___)Perhaps I'll create a PR sometime :-)