8000 gh-132805: annotationlib: Fix handling of non-constant values in FORWARDREF by JelleZijlstra · Pull Request #132812 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
10000

gh-132805: annotationlib: Fix handling of non-constant values in FORWARDREF #132812

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

Merged
merged 15 commits into from
May 4, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove create_unions
  • Loading branch information
JelleZijlstra committed Apr 22, 2025
commit ec4dd0e1fbc619a34f8ace9602c0bafab2eab9f1
4 changes: 1 addition & 3 deletions Lib/annotationlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,13 +519,12 @@ def unary_op(self):


class _StringifierDict(dict):
def __init__(self, namespace, globals=None, owner=None, is_class=False, create_unions=False):
def __init__(self, namespace, globals=None, owner=None, is_class=False):
super().__init__(namespace)
self.namespace = namespace
self.globals = globals
self.owner = owner
self.is_class = is_class
self.create_unions = False
self.stringifiers = []
self.next_id = 1

Expand Down Expand Up @@ -641,7 +640,6 @@ def call_annotate_function(annotate, format, *, owner=None, _is_evaluate=False):
annotate.__globals__,
owner,
is_class,
create_unions=True
)
if annotate.__closure__:
freevars = annotate.__code__.co_freevars
Expand Down
Loading
0