Skip to content

Conversation

@wyattscarpenter
Copy link
Contributor

Change the code of "NoneType should not be used as a type, please use None instead" error to be a new code, so that people who don't like this rule can disable it easily.

I haven't made this a subcode of valid-type because NoneType is actually a valid type; it's just dispreferred.

I have added the documentation for the new code, but haven't added any new tests (the old test still runs fine).

Fixes #20218

@github-actions

This comment has been minimized.

wyattscarpenter and others added 2 commits November 11, 2025 16:50
Change the code of "NoneType should not be used as a type, please use None instead" error to be a new code, so that people who don't like this rule can disable it easily.

I haven't made this a subcode of valid-type because NoneType is actually a valid type; it's just dispreferred.

I have added the documentation for the new code, but haven't added any new tests (the old test still runs fine).

Fixes python#20218
Co-authored-by: A5rocks <[email protected]>
@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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.

The object None works but the type NoneType doesn't work

2 participants