-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
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
Better approach of making a cache #86
Comments
Was reading on this and wanted to clear up somethings. Edit: I just saw the usage of this class and del wasn't used atleast in the python codebase. Please do tell me if it is also being used in the ts base. I will try to implement functools LRU . Will update you if there is any progress from my side. |
i want to work on this issue ,kindly assign me @B4nan , if it's still opened |
We don't assign issues for hacktoberfest. If you want to work on this, open a PR. First mergeable one gets merged. |
Try using something from the standard libraries. |
Hi @vdusek , def test_del(lru_cache: LRUCache[int]) -> None:
# Key error on non-existent key
with pytest.raises(KeyError):
del lru_cache['non-existent-key']
# No error with existing key
len_before_del = len(lru_cache)
del lru_cache['a']
assert len(lru_cache) == len_before_del - 1
assert 'a' not in lru_cache So. if using stl, is the delete function to be kept in the implementation or not? |
Hi @Azathoth-X, if the delete is used only in the tests, I believe we do not need it. |
crawlee/_utils/lru_cache.py
.functools
std module (lru_cache
decorator)?The text was updated successfully, but these errors were encountered: