René's URL Explorer Experiment


Title: Simplify `typing.evaluate_forward_ref` · Issue #133960 · python/cpython · GitHub

Open Graph Title: Simplify `typing.evaluate_forward_ref` · Issue #133960 · python/cpython

X Title: Simplify `typing.evaluate_forward_ref` · Issue #133960 · python/cpython

Description: Bug report In PEP-749 I added typing.evaluate_forward_ref to replace the private typing.ForwardRef._evaluate, which is being used by some external users. The current documentation claims these differences from annotationlib.ForwardRef.ev...

Open Graph Description: Bug report In PEP-749 I added typing.evaluate_forward_ref to replace the private typing.ForwardRef._evaluate, which is being used by some external users. The current documentation claims these diff...

X Description: Bug report In PEP-749 I added typing.evaluate_forward_ref to replace the private typing.ForwardRef._evaluate, which is being used by some external users. The current documentation claims these diff...

Opengraph URL: https://github.com/python/cpython/issues/133960

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Simplify `typing.evaluate_forward_ref`","articleBody":"# Bug report\n\nIn PEP-749 I added `typing.evaluate_forward_ref` to replace the private `typing.ForwardRef._evaluate`, which is being used by some external users.\n\nThe current [documentation](https://docs.python.org/3.14/library/typing.html#typing.evaluate_forward_ref) claims these differences from `annotationlib.ForwardRef.evaluate`:\n\n1. Recursively evaluates forward references nested within the type hint.\n2. Raises TypeError when it encounters certain objects that are not valid type hints.\n3. Replaces type hints that evaluate to None with types.NoneType.\n4. Supports the FORWARDREF and STRING formats.\n\n(1) is useful and fits well with the typing module; annotationlib can't do this because it requires introspecting into typing-specific objects. (2) I feel is not useful (compare #133959): the type check is not particularly thorough, and it's generally better for callers to allow more objects through that callers can handle on their own terms. (3) is sort of harmless but not particularly useful. (4) is not true any more since I also added support for these formats to `ForwardRef.evaluate`.\n\nSo I'd like to drop differences 2 through 4, leaving the function focused on recursively evaluating nested ForwardRefs.\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-133961\n* gh-134663\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2025-05-13T02:09:32Z","url":"https://github.com/python/cpython/issues/133960"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:29c39405-8115-2ba4-52ec-4938688514b3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA274:2C3D4F:391FAF:4CD8DD:6B0028D1
html-safe-nonceb67a803cd7c693311ccabb54e2ce7fb35f3107b93c7739197ed8340ad4975f4a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjc0OjJDM0Q0RjozOTFGQUY6NENEOEREOjZCMDAyOEQxIiwidmlzaXRvcl9pZCI6IjE2MjE4NDQ1ODgzNzUzMjA3ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3565a6ef7603719c6f6fad7434d1c0bbdde3bdb8c255206d61d3f519b4bde82d
hovercard-subject-tagissue:3058567389
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/133960/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bbe5d623940f11496028a089e4718506c470dc1a982080de2138bc24329bc041/python/cpython/issues/133960
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bbe5d623940f11496028a089e4718506c470dc1a982080de2138bc24329bc041/python/cpython/issues/133960
og:image:altBug report In PEP-749 I added typing.evaluate_forward_ref to replace the private typing.ForwardRef._evaluate, which is being used by some external users. The current documentation claims these diff...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJelleZijlstra
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/133960#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F133960
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F133960
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/133960
Reloadhttps://github.com/python/cpython/issues/133960
Reloadhttps://github.com/python/cpython/issues/133960
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/133960
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/133960
Simplify typing.evaluate_forward_refhttps://github.com/python/cpython/issues/133960#top
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-typinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-typing%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on May 13, 2025https://github.com/python/cpython/issues/133960#issue-3058567389
PEP-749https://peps.python.org/749
documentationhttps://docs.python.org/3.14/library/typing.html#typing.evaluate_forward_ref
#133959https://github.com/python/cpython/issues/133959
gh-133960: Improve typing.evaluate_forward_ref #133961https://github.com/python/cpython/pull/133961
[3.14] gh-133960: Improve typing.evaluate_forward_ref (GH-133961) #134663https://github.com/python/cpython/pull/134663
JelleZijlstrahttps://github.com/JelleZijlstra
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
topic-typinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-typing%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
on May 13, 2025https://github.com/python/cpython/issues/133960#event-17626897162
JelleZijlstrahttps://github.com/JelleZijlstra
on May 13, 2025https://github.com/python/cpython/issues/133960#event-17627553188
pythongh-133960: Improve typing.evaluate_forward_refhttps://github.com/JelleZijlstra/cpython/commit/b1f050e99fb259d423d1b8bbafff26675388bdad
pythongh-133960https://github.com/python/cpython/issues/133960
b1f050ehttps://github.com/JelleZijlstra/cpython/commit/b1f050e99fb259d423d1b8bbafff26675388bdad
picnixzhttps://github.com/picnixz
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
on May 15, 2025https://github.com/python/cpython/issues/133960#event-17672327786
JelleZijlstrahttps://github.com/JelleZijlstra
on May 25, 2025https://github.com/python/cpython/issues/133960#event-17805005311
gh-133960: Improve typing.evaluate_forward_ref (#133961)https://github.com/python/cpython/commit/57fef27cfc2bdfc1e3a65ef8c8a760198d15b14d
gh-133960https://github.com/python/cpython/issues/133960
#133961https://github.com/python/cpython/pull/133961
57fef27https://github.com/python/cpython/commit/57fef27cfc2bdfc1e3a65ef8c8a760198d15b14d
miss-islingtonhttps://github.com/miss-islington
on May 25, 2025https://github.com/python/cpython/issues/133960#event-17805005716
pythongh-133960: Improve typing.evaluate_forward_ref (pythonGH-133961)https://github.com/miss-islington/cpython/commit/f64c059c3b046889feb5e1310c7340154524595e
pythongh-133960https://github.com/python/cpython/issues/133960
pythonGH-133961https://github.com/python/cpython/pull/133961
f64c059https://github.com/miss-islington/cpython/commit/f64c059c3b046889feb5e1310c7340154524595e
JelleZijlstrahttps://github.com/JelleZijlstra
on May 25, 2025https://github.com/python/cpython/issues/133960#event-17805064778
[3.14] gh-133960: Improve typing.evaluate_forward_ref (GH-133961) (#1…https://github.com/python/cpython/commit/9c6d2dbe26e30114773bf55147d36960cb89e519
gh-133960https://github.com/python/cpython/issues/133960
GH-133961https://github.com/python/cpython/pull/133961
#1…https://github.com/python/cpython/pull/134663
9c6d2dbhttps://github.com/python/cpython/commit/9c6d2dbe26e30114773bf55147d36960cb89e519
JelleZijlstrahttps://github.com/JelleZijlstra
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 25, 2025https://github.com/python/cpython/issues/133960#event-17805095805
Pranjal095https://github.com/Pranjal095
on Jul 12, 2025https://github.com/python/cpython/issues/133960#event-18600175933
pythongh-133960: Improve typing.evaluate_forward_ref (python#133961)https://github.com/Pranjal095/cpython/commit/fe50df53dfb2e38029bdcf98c9103e819c516135
pythongh-133960https://github.com/python/cpython/issues/133960
python#133961https://github.com/python/cpython/pull/133961
fe50df5https://github.com/Pranjal095/cpython/commit/fe50df53dfb2e38029bdcf98c9103e819c516135
taegyunkimhttps://github.com/taegyunkim
on Aug 4, 2025https://github.com/python/cpython/issues/133960#event-18976826210
pythongh-133960: Improve typing.evaluate_forward_ref (python#133961)https://github.com/taegyunkim/cpython/commit/a9a2ca9efafcaf346c4fd7c75f84eed57e3a6208
pythongh-133960https://github.com/python/cpython/issues/133960
python#133961https://github.com/python/cpython/pull/133961
a9a2ca9https://github.com/taegyunkim/cpython/commit/a9a2ca9efafcaf346c4fd7c75f84eed57e3a6208
gostak-ddhttps://github.com/gostak-dd
on Jun 2, 2026https://github.com/python/cpython/issues/133960#event-26248246233
pythongh-133960: Improve typing.evaluate_forward_ref (python#133961)https://github.com/gostak-dd/cpython/commit/39d149038a0469ce32d5b0ee458e6534cba282b6
pythongh-133960https://github.com/python/cpython/issues/133960
python#133961https://github.com/python/cpython/pull/133961
39d1490https://github.com/gostak-dd/cpython/commit/39d149038a0469ce32d5b0ee458e6534cba282b6
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/133960
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/133960
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-typinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-typing%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.