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 signature for generic structure hooks #107

Merged
merged 1 commit into from
Nov 2, 2020

Conversation

tdsmith
Copy link
Contributor

@tdsmith tdsmith commented Nov 2, 2020

A generic structure hook is expected to return a value of the type that it accepts as an argument.

I feel guilty submitting a two-byte PR but I noticed that there aren't any tests that invoke mypy. Would it be useful to do some type checking as part of the test suite?

Closes #106.

A generic structure hook is expected to return a value of the type that it accepts as an argument.
@Tinche
Copy link
Member

Tinche commented Nov 2, 2020

Thanks. Are there established ways of testing type annotations?

@Tinche Tinche merged commit 1ab1cb2 into python-attrs:master Nov 2, 2020
@tdsmith tdsmith deleted the issue106 branch November 2, 2020 23:14
@tdsmith
Copy link
Contributor Author

tdsmith commented Nov 2, 2020

I've only worked on a couple of typed projects but I think that type-checking the unit tests or some other corpus of examples should give coverage.

@Tinche
Copy link
Member

Tinche commented Nov 2, 2020

How do you test for failures though?

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.

Type checking fails when registering a generic structure hook
2 participants