Skip to content

Defined _NoneType class in typing.pyi that type checkers can use to… #4519

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

Merged
merged 7 commits into from
Sep 20, 2020
7 changes: 6 additions & 1 deletion stdlib/2and3/_typeshed/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import array
import mmap
import sys
from typing import AbstractSet, Container, Iterable, Protocol, Text, Tuple, TypeVar, Union
from typing_extensions import Literal
from typing_extensions import Literal, final

_KT = TypeVar("_KT")
_KT_co = TypeVar("_KT_co", covariant=True)
Expand Down Expand Up @@ -164,3 +164,8 @@ if sys.version_info >= (3,):
else:
ReadableBuffer = Union[bytes, bytearray, memoryview, array.array, mmap.mmap, buffer]
WriteableBuffer = Union[bytearray, memoryview, array.array, mmap.mmap, buffer]

# Used by type checkers for checks involving None (does not exist at runtime)
@final
class NoneType:
def __bool__(self) -> Literal[False]: ...