Skip to content
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

Replace lru_cache usage with cache #35

Open
gselzer opened this issue Mar 30, 2022 · 0 comments
Open

Replace lru_cache usage with cache #35

gselzer opened this issue Mar 30, 2022 · 0 comments
Milestone

Comments

@gselzer
Copy link
Member

gselzer commented Mar 30, 2022

functools.lru_cache provides a nice way of caching function returns, and is super useful for things like jimport. As @ctrueden noted, however:

I think @cache is the nicest. It just implies (rightly so) that function results are cached and returned again the second time. Whereas lru_cache(maxsize=None) is an oxymoron to me: if there is no size limit, it's not "LRU" anymore.

This is a good point. Unfortunately, functools.cache is a feature introduced in Python 3.9, while scyjava requires >=3.6 and tests 3.8

Once we move on from these Python versions, we should probably reevaulate the usage of lru_cache on jimport.

@ctrueden ctrueden added this to the unscheduled milestone Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants