Skip to content

Conversation

@AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jun 15, 2022

This PR removes mypy error codes from the test_cases directory, and alters mypy_test so that it no longer enforces that type: ignores in the test_cases directory have mypy error codes.

When I created the first test cases, it seemed like a good idea to enforce mypy error codes, as we use mypy error codes in most of the rest of typeshed. But type: ignores in the test_cases directory serve a different purpose to those in the rest of typeshed -- whereas in the rest of typeshed we use them to stop a type checker complaining where we're doing something it doesn't quite understand, in the test_cases directory we use them to signify "this code is meant to fail a type checker". As a result, whereas the error codes in the rest of typeshed help make the stubs more self-documenting, it feels like the error codes in the test_cases directory just end up adding noise. They're also mypy-specific, and, in general, we should probably aim to have as little stuff in typeshed as possible that's specific to one type checker.

More discussion here: #8066 (comment)

@AlexWaygood AlexWaygood requested a review from Akuli June 15, 2022 14:27
@AlexWaygood AlexWaygood merged commit 5fa31e6 into python:master Jun 15, 2022
@AlexWaygood AlexWaygood deleted the tests branch June 15, 2022 14:31
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