From e708c1689aba324ba0c0d22f5f5bf2caae26949b Mon Sep 17 00:00:00 2001 From: KotlinIsland Date: Thu, 7 Oct 2021 11:45:00 +1000 Subject: [PATCH] Make types.NoneType actually the type of None, instead of just some unrelated class. --- stdlib/types.pyi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 26d8263ead21..f002f2cb0aa8 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -19,7 +19,7 @@ from typing import ( ValuesView, overload, ) -from typing_extensions import Literal, final +from typing_extensions import final # Note, all classes "defined" here require special handling. @@ -379,9 +379,7 @@ if sys.version_info >= (3, 9): def __getattr__(self, name: str) -> Any: ... # incomplete if sys.version_info >= (3, 10): - @final - class NoneType: - def __bool__(self) -> Literal[False]: ... + NoneType = type(None) EllipsisType = ellipsis # noqa F811 from builtins from builtins import _NotImplementedType