Skip to content

fix(visualizer): replace functools.cache with lru_cache for Python 3.8 compatibility#12

Merged
AmitMY merged 1 commit into
sign-language-processing:mainfrom
bricksdont:python38_support
Feb 28, 2026
Merged

fix(visualizer): replace functools.cache with lru_cache for Python 3.8 compatibility#12
AmitMY merged 1 commit into
sign-language-processing:mainfrom
bricksdont:python38_support

Conversation

@bricksdont
Copy link
Copy Markdown
Contributor

Summary

  • functools.cache was introduced in Python 3.9 and causes an ImportError on Python 3.8
  • Replace from functools import cache with from functools import lru_cache
  • Replace @cache with @lru_cache(maxsize=None) — these are exactly equivalent, but lru_cache is available from Python 3.2+

Test plan

  • Verify the module imports without error on Python 3.8
  • Verify existing tests pass (caching behaviour is unchanged)

🤖 Generated with Claude Code

…8 compatibility

functools.cache was introduced in Python 3.9; replacing it with
lru_cache(maxsize=None) is exactly equivalent but works from Python 3.2+.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bricksdont
Copy link
Copy Markdown
Contributor Author

requesting this change because of Python 3.8 test runs failing in repositories that use signwriting: https://github.com/GerrySant/multimodalhugs/actions/runs/22485873079/job/65135229531?pr=68

and would be good to know: what Python versions are actually supported? if Python 3.8 or other versions are also supported, could the test / actions matrix be extended to those versions?

Copy link
Copy Markdown
Contributor

@AmitMY AmitMY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok! i guess later versions will require python 3.10 or above, 3.8 is very old now

@AmitMY AmitMY merged commit d79e26c into sign-language-processing:main Feb 28, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants