cachier icon indicating copy to clipboard operation
cachier copied to clipboard

Identical keys for different signatures when using tuple positional arguments

Open shaypal5 opened this issue 4 years ago • 2 comments

To create the key for a cache entry, the current implementation uses the following expression:

key = args + tuple(sorted(kwds.items()))

For a function with signature spam(*args, **kwargs), this will generate the same key for spam(1, a=2) and spam(1, ("a", 2)), which may be undesirable.

shaypal5 avatar Jun 27 '21 07:06 shaypal5

@benzlock could you please rebase over the latest master and open a new PR for your fix? :)

shaypal5 avatar Oct 14 '21 09:10 shaypal5

See #81 : https://github.com/shaypal5/cachier/pull/81

Could easily be added to the current code base, I think.

shaypal5 avatar Nov 15 '21 15:11 shaypal5

Solved by PR #104

shaypal5 avatar Mar 19 '23 10:03 shaypal5