← 返回首页
Replace lru_cache usage with cache · Issue #35 · scijava/scyjava · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Replace lru_cache usage with cache #35

New issue
New issue

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Footer

      © 2026 GitHub, Inc.