summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2024-04-30 15:44:37 (GMT)
committerGitHub <noreply@github.com>2024-04-30 15:44:37 (GMT)
commit4a5ad8469af9a6fc0ec1355eb203cc22bb4321d5 (patch)
tree240b3cf9cce0504d89597e1224195f7cb6282969
parent72dae53e09a5344bf4922d934a34a2fa48a11c86 (diff)
downloadcpython-4a5ad8469af9a6fc0ec1355eb203cc22bb4321d5.zip
cpython-4a5ad8469af9a6fc0ec1355eb203cc22bb4321d5.tar.gz
cpython-4a5ad8469af9a6fc0ec1355eb203cc22bb4321d5.tar.bz2
gh-118418: Use a default value for `type_params` in `typing._eval_type` (#118431)
-rw-r--r--Lib/typing.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index b3f4ba9..eff65cf 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -400,7 +400,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().
@@ -981,7 +981,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: