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-128661: Fixtyping.evaluate_forward_ref not showing deprecation#128663

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
sobolevn merged 1 commit intopython:mainfromsobolevn:issue-128661
Jan 9, 2025

Conversation

@sobolevn
Copy link
Member

@sobolevnsobolevn commentedJan 9, 2025
edited by bedevere-appbot
Loading

Now callingtyping.evaluate_forward_ref withouttype_params raises a warning, as it should.
CallingForwardRef._evaluate only raises 1 warning, as it should.

I've also covered all branches. After:
Снимок экрана 2025-01-09 в 12 04 04

No backports are needed, this is 3.14 only feature.

nohzafk reacted with thumbs up emoji
@AlexWaygoodAlexWaygood changed the titlegh-128661: Fixtyping.evaluate_forward_ref not showing deprecataiongh-128661: Fixtyping.evaluate_forward_ref not showing deprecationJan 9, 2025
@sobolevnsobolevn merged commitb725297 intopython:mainJan 9, 2025
44 checks passed
@JelleZijlstra
Copy link
Member

I don't think we should have done this; it makes the interface excessively clunky.

@sobolevn
Copy link
MemberAuthor

@JelleZijlstra what's your opinion about the alternative?

@JelleZijlstra
Copy link
Member

The code was correct as is. Forcing people to writetype_params=() to handle a rare edge case is not friendly to users.

@sobolevn
Copy link
MemberAuthor

Hm, looks like other similar APIs also has this pattern. Liketyping._eval_type andForwardRef._evaluate.

I got confused by

cpython/Lib/typing.py

Lines 1053 to 1055 in1b39b50

iftype_paramsis_sentinel:
_deprecation_warning_for_no_type_params_passed("typing.evaluate_forward_ref")
type_params= ()
How can anybody pass_sentinel there, if it is not a default?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

@JelleZijlstraJelleZijlstraAwaiting requested review from JelleZijlstraJelleZijlstra is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@sobolevn@JelleZijlstra@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp