Skip to content

Fix signature for generic structure hooks#107

Merged
Tinche merged 1 commit intopython-attrs:masterfrom
tdsmith:issue106
Nov 2, 2020
Merged

Fix signature for generic structure hooks#107
Tinche merged 1 commit intopython-attrs:masterfrom
tdsmith:issue106

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