Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down Expand Up @@ -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:
Expand Down
Loading