Skip to content

Commit 2f73f30

Browse files
authored
style: Empty placeholder type should be @final
mypy soon will have special narrowing for `@final` singleton types: python/mypy#15646 So, it is a good idea to use `@final` for such types.
1 parent b5f31a9 commit 2f73f30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

litestar/types/empty.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
__all__ = ("Empty", "EmptyType")
44

5-
from typing import TYPE_CHECKING, Type
5+
from typing import TYPE_CHECKING, Type, final
66

77
if TYPE_CHECKING:
88
from typing_extensions import TypeAlias
99

1010

11+
@final
1112
class Empty:
1213
"""A sentinel class used as placeholder."""
1314

0 commit comments

Comments
 (0)