Skip to content

Commit 34c91be

Browse files
authored
Add @final to NotImplementedType and ellipsis (#6291)
These aren't subclassable at runtime. (Missed these two in my previous PR due to the fact that they're exposed in the `types` module, rather than builtins, at runtime. Also they're both a little weird to say the least, so let's see what the CI thinks...)
1 parent f6e697f commit 34c91be

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/builtins.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ class property(object):
979979
def __set__(self, __obj: Any, __value: Any) -> None: ...
980980
def __delete__(self, __obj: Any) -> None: ...
981981

982+
@final
982983
class _NotImplementedType(Any): # type: ignore
983984
# A little weird, but typing the __call__ as NotImplemented makes the error message
984985
# for NotImplemented() much better
@@ -1440,6 +1441,7 @@ def __import__(
14401441

14411442
# Actually the type of Ellipsis is <type 'ellipsis'>, but since it's
14421443
# not exposed anywhere under that name, we make it private here.
1444+
@final
14431445
class ellipsis: ...
14441446

14451447
Ellipsis: ellipsis

0 commit comments

Comments
 (0)