Skip to content

Commit 9fc1381

Browse files
author
Bas van Beek
committed
Reintroduced types.NoneType and types.NotImplementedType
1 parent 307dcc1 commit 9fc1381

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Lib/test/test_types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,12 @@ def test_or_type_repr(self):
716716
def test_ellipsis_type(self):
717717
self.assertIsInstance(Ellipsis, types.EllipsisType)
718718

719+
def test_notimplemented_type(self):
720+
self.assertIsInstance(NotImplemented, types.NotImplementedType)
721+
722+
def test_none_type(self):
723+
self.assertIsInstance(None, types.NoneType)
724+
719725

720726
class MappingProxyTests(unittest.TestCase):
721727
mappingproxy = types.MappingProxyType

Lib/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,5 +297,7 @@ def wrapped(*args, **kwargs):
297297
Union = type(int | str)
298298

299299
EllipsisType = type(Ellipsis)
300+
NoneType = type(None)
301+
NotImplementedType = type(NotImplemented)
300302

301303
__all__ = [n for n in globals() if n[:1] != '_']

0 commit comments

Comments
 (0)