Title: Implement PEP 649 and PEP 749 · Issue #119180 · python/cpython · GitHub
Open Graph Title: Implement PEP 649 and PEP 749 · Issue #119180 · python/cpython
X Title: Implement PEP 649 and PEP 749 · Issue #119180 · python/cpython
Description: PEP-649 has been accepted and should be implemented in Python 3.14. Let's use this issue to track the implementation: Decide on or clarify the adoption strategy (https://discuss.python.org/t/pep-649-deferred-evaluation-of-annotations-ten...
Open Graph Description: PEP-649 has been accepted and should be implemented in Python 3.14. Let's use this issue to track the implementation: Decide on or clarify the adoption strategy (https://discuss.python.org/t/pep-64...
X Description: PEP-649 has been accepted and should be implemented in Python 3.14. Let's use this issue to track the implementation: Decide on or clarify the adoption strategy (https://discuss.python.org/t/pe...
Opengraph URL: https://github.com/python/cpython/issues/119180
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Implement PEP 649 and PEP 749","articleBody":"PEP-649 has been accepted and should be implemented in Python 3.14. Let's use this issue to track the implementation:\n\n- [x] Decide on or clarify the adoption strategy (https://discuss.python.org/t/pep-649-deferred-evaluation-of-annotations-tentatively-accepted/21331/44)\n- [x] Add new `__annotate__` attributes #119209\n- [x] Implement core interpreter changes (e.g., new symbol table functionality) #119361\n- [x] Implement new Python-level APIs, like the new `format` argument to `inspect.get_annotations` #119891\n - [x] (PEP-649 specifies that `inspect.AnnotationsFormat` should be a \"global enum\". Is that desirable? TBD. https://github.com/python/cpython/pull/119361/files#r1614753031)\n- [x] Document the new semantics #122235 \n - [ ] Add higher-level documentation, e.g. a migration guide away from `from __future__ import annotations`; an introduction to annotationlib; an update to Larry's annotations HOWTO\n - [ ] The SC would like https://peps.python.org/pep-0749/#appendix incorporated into the docs\n- [x] Make staticmethod and classmethod not force evaluation of annotations #119864\n- [x] Adapt standard library code that uses annotations to work excellently with PEP 649\n - [x] dataclasses #119891\n - [x] typing.py: TypedDict, NamedTuple, try to remove dependency on `inspect`. (If it can't be removed, get rid of the awkward dance we do for `typing.Protocol` to import `inspect.getattr_static` lazily.)\n - [x] singledispatch #119891\n - [x] Also make it only evaluate the relevant parameter, https://github.com/python/cpython/pull/119891#discussion_r1636397226\n - [x] functools.update_wrapper #119891, #124342\n- [x] Add PEP 649-like functionality to TypeAliasType, TypeVar, etc. (`pep649-typevar` branch in my fork)\n- [ ] Make sure the ecosystem is ready by testing third-party libraries like Pydantic\n - [x] typing_extensions: needs changes similar to those in typing.py (python/typing_extensions#412)\n - [ ] beartype: had various unrelated problems on 3.13 (beartype/beartype#387); a few additional tests fail on the PR branch due to direct manipulation of `__dict__`\n - [ ] typeguard: some unrelated 3.13 problems (agronholm/typeguard#460); no test failures related to PEP 649\n - [ ] pyanalyze: some unrelated 3.13 issues and a few changes necessary due to direct `__dict__` access (quora/pyanalyze#773)\n - [ ] pydantic: failed to build for 3.14 so far\n- [ ] Optimize the implementation. Ideas:\n - [ ] Avoid creation of function objects and store only code objects instead #124157\n - [x] Avoid creation of AST nodes and use of eval() for ForwardRefs that are just names #124337\n\nThings to revisit:\n\n- [x] Should FORWARDREF be the default? https://github.com/beartype/beartype/pull/440#issuecomment-2373086020\n- [x] Add VALUE_WITH_FAKE_GLOBALS format\n- [x] Name of `__annotate__` parameter\n- [x] Should setting `__annotations__` invalidate `__annotate__`?\n- [x] Rename SOURCE to STRING?\n\nI am planning to work on the interpreter core first.\n\ncc @larryhastings @carljm @samuelcolvin \n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-119209\n* gh-119321\n* gh-119361\n* gh-119397\n* gh-119864\n* gh-119891\n* gh-120719\n* gh-120816\n* gh-122074\n* gh-122210\n* gh-122212\n* gh-122235\n* gh-122365\n* gh-122366\n* gh-124326\n* gh-124337\n* gh-124393\n* gh-124415\n* gh-124461\n* gh-124479\n* gh-124561\n* gh-124620\n* gh-124634\n* gh-124730\n* gh-131755\n* gh-133407\n* gh-133552\n* gh-133841\n* gh-133902\n* gh-133903\n* gh-134640\n* gh-134731\n* gh-135644\n* gh-135654\n* gh-137247\n* gh-137263\n* gh-143758\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2024-05-19T15:34:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/119180/cpython/issues/119180"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:710af266-c277-06f9-ea51-ceeaa9f2707e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E542:311995:32AB127:425D75E:696B8CE2 |
| html-safe-nonce | 5dd2160cd326f0e5e875f79a699f0790be8b7139b6b03004a0aab71428d5aa13 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTQyOjMxMTk5NTozMkFCMTI3OjQyNUQ3NUU6Njk2QjhDRTIiLCJ2aXNpdG9yX2lkIjoiNDg4MzI2Nzc2MzA3ODY2MzM5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a35283be9e220c42eb56aa5148566fa19331e9cfdec6b7a165d569c38b565bfd |
| hovercard-subject-tag | issue:2304664735 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/119180/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86791d93febbf0878e8f6ef4bc99013eab28d69a71a8a4824eeed64de0553df1/python/cpython/issues/119180 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86791d93febbf0878e8f6ef4bc99013eab28d69a71a8a4824eeed64de0553df1/python/cpython/issues/119180 |
| og:image:alt | PEP-649 has been accepted and should be implemented in Python 3.14. Let's use this issue to track the implementation: Decide on or clarify the adoption strategy (https://discuss.python.org/t/pep-64... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JelleZijlstra |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width