Skip to content

fix: incorrect type hints on memoize key #958#959

Merged
maartenbreddels merged 2 commits intowidgetti:masterfrom
ntjess:fix-cache-key-hint
Jan 29, 2025
Merged

fix: incorrect type hints on memoize key #958#959
maartenbreddels merged 2 commits intowidgetti:masterfrom
ntjess:fix-cache-key-hint

Conversation

@ntjess
Copy link
Copy Markdown
Contributor

@ntjess ntjess commented Jan 5, 2025

All Submissions:

Description of changes

Type hints now make code editors happy when caching non-hashable function inputs (fixes #958)

Copy link
Copy Markdown
Collaborator

@iisakkirotko iisakkirotko left a comment

Choose a reason for hiding this comment

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

Hi @ntjess! Thanks a lot for the PR (and good spot on the issue)!

It seem that as of Python 3.12, importing typing.Hashable is deprecated (see the Python docs), and should be imported from collections.abc instead.

@ntjess
Copy link
Copy Markdown
Contributor Author

ntjess commented Jan 23, 2025

@iisakkirotko Done!

Copy link
Copy Markdown
Collaborator

@iisakkirotko iisakkirotko left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@maartenbreddels
Copy link
Copy Markdown
Contributor

Nice work, thanks Nathan!

@maartenbreddels maartenbreddels merged commit 26ebb83 into widgetti:master Jan 29, 2025
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.

Incorrect type hints on memoize key

3 participants