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

Fix Python 3.8 Compatibility: Replace functools.cache with functools.lru_cache #2113

Merged

Conversation

debjeetsingha
Copy link
Contributor

What does this change

Changed code to be functional in python 3.8

What was wrong

functools.cache, a shorthand for functools.lru_cache(maxsize=None) was causing errors

How this fixes it

Replaced @functools.cache with @functools.lru_cache(maxsize=None)

Fixes #2112

Checklist

  • I have read the documentation about CONTRIBUTING
  • I have run make lint

@onesch
Copy link
Contributor

onesch commented Oct 5, 2024

why does it complain about typing 3.8 and say there is no functools.cache if you have already changed it to @functools.lru_cache(maxsize=None)

Copy link
Collaborator

@fcurella fcurella left a comment

Choose a reason for hiding this comment

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

Thank you!

@fcurella fcurella merged commit ef3a5e2 into joke2k:master Oct 7, 2024
13 of 14 checks passed
@huonw
Copy link
Contributor

huonw commented Oct 8, 2024

Thank you for fixing my oversight!

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.

4 participants