Skip to content

Commit 949eacf

Browse files
committed
Switch to manual warning of sentinel subclassing
1 parent e306cc1 commit 949eacf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/typing_extensions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,12 @@ def __init__(
213213
# For pickling as a singleton:
214214
self.__module__ = _caller()
215215

216-
@deprecated("Subclassing sentinel is forbidden by PEP 661")
217216
def __init_subclass__(cls):
217+
warnings.warn(
218+
"Subclassing sentinel is forbidden by PEP 661",
219+
DeprecationWarning,
220+
stacklevel=2,
221+
)
218222
super().__init_subclass__()
219223

220224
def __setattr__(self, attr: str, value: object) -> None:

0 commit comments

Comments
 (0)