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

Better parametrized domain type #22

Merged
merged 8 commits into from
Jul 26, 2023
Merged

Conversation

SimonHeybrock
Copy link
Member

This changes Scope to take the aliased type as a second parameter. This is required for detecting more issues via mypy.

I could not find a way of automatically also inheriting from this class, so now we have to specify this twice. In practice we may often reuse the same Scope subclass many times (see ArrayT example test), so this is hopefully not too much overhead.

...

A[Param1](1.5)
A[Param1]('abc') # type: ignore[arg-type]
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that all tests in this file pass at runtime. mypy complains if we remove any of the type: ignore comments, but also complains if we put too many, since our config ensures that unused ignore comments are not allowed.

Base automatically changed from getting-started-docs to main July 25, 2023 13:23
@SimonHeybrock SimonHeybrock merged commit 5c9a0e5 into main Jul 26, 2023
@SimonHeybrock SimonHeybrock deleted the better-parametrized-domain-type branch July 26, 2023 08:39
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