Title: typing docs: Use soft deprecation · Issue #132941 · python/cpython · GitHub
Open Graph Title: typing docs: Use soft deprecation · Issue #132941 · python/cpython
X Title: typing docs: Use soft deprecation · Issue #132941 · python/cpython
Description: A while ago we introduced the concept of "soft deprecation" in PEP 387 (https://peps.python.org/pep-0387/#soft-deprecation): for things that we no longer recommend using, but which we aren't planning to remove in the near future. The typ...
Open Graph Description: A while ago we introduced the concept of "soft deprecation" in PEP 387 (https://peps.python.org/pep-0387/#soft-deprecation): for things that we no longer recommend using, but which we aren't planni...
X Description: A while ago we introduced the concept of "soft deprecation" in PEP 387 (https://peps.python.org/pep-0387/#soft-deprecation): for things that we no longer recommend using, but which we are...
Opengraph URL: https://github.com/python/cpython/issues/132941
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"typing docs: Use soft deprecation","articleBody":"A while ago we introduced the concept of \"soft deprecation\" in PEP 387 (https://peps.python.org/pep-0387/#soft-deprecation): for things that we no longer recommend using, but which we aren't planning to remove in the near future.\n\nThe typing docs already list four classes of objects that are deprecated without a scheduled removal (https://docs.python.org/3.14/library/typing.html#deprecation-timeline-of-major-features):\n\n* Pre-PEP-585 generic aliases (e.g. `List`)\n* `Text`\n* `Hashable` and `Sized`\n* `TypeAlias`\n\nI'd like to also soft-deprecate the following:\n\n* `Optional` (obviated by PEP-604)\n* `NoReturn` (prefer `Never`)\n* `typing.ForwardRef` (deprecated alias for `annotationlib.ForwardRef`)\n* `types.UnionType` (deprecated alias for `typing.Union`)\n* Creating a `Union` using subscripting (`Union[A, B]` instead of `A | B`) (PEP-604)\n* Creating a `TypeVar`, `ParamSpec`, or `TypeVarTuple` using the constructor directly (PEP-695)\n* Directly inheriting from `Generic` (PEP-695)\n\nNone of those will be removable for many years if ever, but I think it's useful to have a clear statement in the docs that the newer syntax is preferred.","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2025-04-25T14:05:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/132941/cpython/issues/132941"}
| 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:00b71d6c-71fe-3627-f028-7962f2c2cf67 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEE6:12343F:135670C:19D4D79:696AD680 |
| html-safe-nonce | 13c0406dd83bf880e85344aa63f11923edcb8231fe172df8ecad0004c3e8458e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUU2OjEyMzQzRjoxMzU2NzBDOjE5RDRENzk6Njk2QUQ2ODAiLCJ2aXNpdG9yX2lkIjoiOTc3Mjk0MTE3NDc5MDQ0NzM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e96d251354571ba97b21ebb8aad8edf1a4f0e0a30a05f5eec9576e70f934c0c2 |
| hovercard-subject-tag | issue:3020169605 |
| 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/132941/issue_layout |
| twitter:image | https://opengraph.githubassets.com/08237cf05cae8d5d2268a80a917e926e79e9072efee52c7dc24e7cca86dab63b/python/cpython/issues/132941 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/08237cf05cae8d5d2268a80a917e926e79e9072efee52c7dc24e7cca86dab63b/python/cpython/issues/132941 |
| og:image:alt | A while ago we introduced the concept of "soft deprecation" in PEP 387 (https://peps.python.org/pep-0387/#soft-deprecation): for things that we no longer recommend using, but which we aren't planni... |
| 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 | c785f4ce187e9e7331257791b36ddee01625bb8e292a9b4fe2c16d4c006abf5d |
| 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 | c718a376fcf780eb22089171adb84a543f660bf7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width