From 2983ad60cc195e4fc4fbdf763dc9ae819dea0c92 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 30 Apr 2024 18:44:37 +0300 Subject: [PATCH] gh-118418: Use a default value for `type_params` in `typing._eval_type` (GH-118431) (cherry picked from commit 4a5ad8469af9a6fc0ec1355eb203cc22bb4321d5) Co-authored-by: Nikita Sobolev --- Lib/typing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/typing.py b/Lib/typing.py index 9e39ffe9067850..882dc4da58e914 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -404,7 +404,7 @@ def inner(*args, **kwds): 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 @@ def __init__(self, arg, is_argument=True, module=None, *, is_class=False): 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: