https://github.com/python/cpython/commit/0586d5424133af3f1ed61438017393e52eadb51b
commit: 0586d5424133af3f1ed61438017393e52eadb51b
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: AlexWaygood <[email protected]>
date: 2024-04-30T16:26:38Z
summary:

[3.12] gh-118418: Use a default value for `type_params` in `typing._eval_type` 
(GH-118431) (#118436)

Co-authored-by: Nikita Sobolev <[email protected]>

files:
M Lib/typing.py

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:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to