Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-129463: Remove two attributes from ForwardRef equality#132283

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JelleZijlstra merged 1 commit intopython:mainfromJelleZijlstra:no-code-compare
Apr 15, 2025

Conversation

@JelleZijlstra
Copy link
Member

@JelleZijlstraJelleZijlstra commentedApr 8, 2025
edited by bedevere-appbot
Loading

  • __code__ is created on demand in the__forward_code__ property
  • __ast_node__ is used together with__arg__ to compute__forward_arg__, which is already used by itself in the comparison

@JelleZijlstra
Copy link
MemberAuthor

We should also move the ForwardRef tests out of test_typing, I can do that in a later PR

AlexWaygood reacted with thumbs up emoji

@AlexWaygood
Copy link
Member

Where areForwardRef.__globals__ andForwardRef.__cell__ set? Those are also initialised toNone in__init__. I see reads of these attributes but no obvious writes to them inannotationlib.py other than the__init__ initialisations toNone; are they set dynamically somewhere?

@JelleZijlstra
Copy link
MemberAuthor

They are set on _Stringifier objects, which are turned into ForwardRefs through__class__ assignment.

@AlexWaygood
Copy link
Member

They are set on _Stringifier objects, which are turned into ForwardRefs through__class__ assignment.

could be worth adding some comments above theNone initialisations inForwardRef.__init__; this definitely was a bit confusing as someone who hadn't read the code or the PEP recently!

@JelleZijlstraJelleZijlstra merged commit5e80fee intopython:mainApr 15, 2025
45 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@JelleZijlstra@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp