aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-04-30 18:26:38 +0200
committerGitHub <noreply@github.com>2024-04-30 16:26:38 +0000
commit0586d5424133af3f1ed61438017393e52eadb51b (patch)
tree24ea153b06cd072d6cd9f858d7bafca5da57a1ff
parenta030bae58498aa9e1bdecc355638383a109168bd (diff)
downloadcpython3-0586d5424133af3f1ed61438017393e52eadb51b.tar.gz
[3.12] gh-118418: Use a default value for `type_params` in `typing._eval_type` (GH-118431) (#118436)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
-rw-r--r--Lib/typing.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index 9e39ffe906..882dc4da58 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -404,7 +404,7 @@ def _tp_cache(func=None, /, *, typed=False):
return decorator
-def _eval_type(t, globalns, localns, type_params, *, recursive_guard=frozenset()):
+def _eval_type(t, globalns, localns, type_params=None, *, recursive_guard=frozenset()):
"""Evaluate all forward references in the given type t.
For use of globalns and localns see the docstring for get_type_hints().
@@ -913,7 +913,7 @@ class ForwardRef(_Final, _root=True):
self.__forward_is_class__ = is_class
self.__forward_module__ = module
- def _evaluate(self, globalns, localns, type_params, *, recursive_guard):
+ def _evaluate(self, globalns, localns, type_params=None, *, recursive_guard):
if self.__forward_arg__ in recursive_guard:
return self
if not self.__forward_evaluated__ or localns is not globalns: