From 2f077b6991f59c51989b65618317297c1eb0fb95 Mon Sep 17 00:00:00 2001 From: Gregory Beauregard Date: Sat, 5 Feb 2022 07:50:00 -0800 Subject: [PATCH] Fix __init_subclass__ using self instead of class (#31135) --- Lib/typing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/typing.py b/Lib/typing.py index 0cf9755022e..e4e32b5b320 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -349,7 +349,7 @@ class _Final: __slots__ = ('__weakref__',) - def __init_subclass__(self, /, *args, **kwds): + def __init_subclass__(cls, /, *args, **kwds): if '_root' not in kwds: raise TypeError("Cannot subclass special typing classes")