We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LRUCache.set does not update the cache value when the key exists, this may confuse the user. Why is it designed this way?
def set(self, key: K, value: V): if self.cache.get(key): self.cache.move_to_end(key, last=True) else: self.cache[key] = value if self.capacity is not None and self.length > self.capacity: self.cache.popitem(last=False)
The text was updated successfully, but these errors were encountered:
Good point! Would you like to contribute a bugfix on this?
Sorry, something went wrong.
fix: #573
Fixed in #573
v4.8.2 includes this fix and has been released
No branches or pull requests
LRUCache.set does not update the cache value when the key exists, this may confuse the user. Why is it designed this way?
The text was updated successfully, but these errors were encountered: