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

Opt frozen dataclass #272

Merged
merged 3 commits into from
Nov 28, 2024
Merged

Opt frozen dataclass #272

merged 3 commits into from
Nov 28, 2024

Conversation

inducer
Copy link
Owner

@inducer inducer commented Nov 28, 2024

No description provided.

@inducer inducer merged commit ac85c95 into main Nov 28, 2024
17 checks passed
@inducer inducer deleted the opt-frozen-dataclass branch November 28, 2024 06:19
@@ -903,7 +910,7 @@ def new_inner(*args: P.args, **kwargs: P.kwargs) -> R:
return new_inner


class keyed_memoize_in(Generic[P, R]): # noqa: N801
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this not needed? I thought it constrained the __call__ inputs

Copy link
Owner Author

Choose a reason for hiding this comment

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

The problem I encountered is that R does not get bound at construction time, and so mypy helpfully binds it to Never, which it expects as the return value of the function. pyright seemed to agree that R would not get bound.

__call__ is still an R-generic function.

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