Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treating NoneType as None and warning against using NoneType. (#13153)
### Description Fixes #11288 Warns people to not use `NoneType` as a type annotation, as requested in #11288. ### Example **Before** ```python from types import NoneType def f(x: NoneType) -> None: pass f(None) # E: Argument 1 to "f" has incompatible type "None"; expected "NoneType" ``` **After** ```python from types import NoneType def f(x: NoneType) -> None: # E: NoneType should not be used as a type, please use None instead pass f(None) ``` Had to edit `test-data/unit/lib-stub/types.pyi` to allow NoneType type annotation.
- Loading branch information