Title: How to extend `warnings.deprecated`? · Issue #2256 · python/typing · GitHub
Open Graph Title: How to extend `warnings.deprecated`? · Issue #2256 · python/typing
X Title: How to extend `warnings.deprecated`? · Issue #2256 · python/typing
Description: We need more metadata for our deprecation decorator, but the spec doesn’t say how deprecated marks an API. So the only way to mark something as deprecated it is by creating an API with the same exact signature and replace it with warning...
Open Graph Description: We need more metadata for our deprecation decorator, but the spec doesn’t say how deprecated marks an API. So the only way to mark something as deprecated it is by creating an API with the same exa...
X Description: We need more metadata for our deprecation decorator, but the spec doesn’t say how deprecated marks an API. So the only way to mark something as deprecated it is by creating an API with the same exa...
Opengraph URL: https://github.com/python/typing/issues/2256
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to extend `warnings.deprecated`?","articleBody":"We need more metadata for our deprecation decorator, but the spec doesn’t say *how* `deprecated` marks an API. So the only way to mark something as deprecated it is by creating an API with the same exact signature and replace it with `warnings.deprecated` at the type level:\n\n```python\nif TYPE_CHECKING:\n from warnings import deprecated\nelse:\n def deprecated[F](msg: str) -> Callable[[F], F]: ...\n```\n\nWe need to define `deprecated(msg: str, version: packaging.Version)` and have it work with the type system. How?","author":{"url":"https://github.com/flying-sheep","@type":"Person","name":"flying-sheep"},"datePublished":"2026-04-09T08:47:06Z","url":"https://github.com/python/typing/issues/2256"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:42002b6c-cc79-5be6-faf6-527279f03a45 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED78:2D57E8:143FCD:1A2059:6AFF828C |
| html-safe-nonce | e073531713012e330795c30aaba80cf2876b211e426d9ad3e52ce99c04ce5f72 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDc4OjJENTdFODoxNDNGQ0Q6MUEyMDU5OjZBRkY4MjhDIiwidmlzaXRvcl9pZCI6IjM5MTQ5MTE2NTkwMjEyNzE2OTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d21950f776f15b19f83483f985c2c3f48d0d215e2edc6ac46bc9d5ef2fcc2cc7 |
| hovercard-subject-tag | issue:4230829316 |
| 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/typing/2256/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2929799864511637482720a02d5d04d207ae25c7a2bf888f0ad320cc860785b4/python/typing/issues/2256 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2929799864511637482720a02d5d04d207ae25c7a2bf888f0ad320cc860785b4/python/typing/issues/2256 |
| og:image:alt | We need more metadata for our deprecation decorator, but the spec doesn’t say how deprecated marks an API. So the only way to mark something as deprecated it is by creating an API with the same exa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | flying-sheep |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19488db4031f00b04ea79b4c70b5dd32cfa873a8d20b3877f3896b8e2d195946 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typing git https://github.com/python/typing.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 24604008 |
| octolytics-dimension-repository_nwo | python/typing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24604008 |
| octolytics-dimension-repository_network_root_nwo | python/typing |
| 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 | 7952f5285f4ba685d70c4c7540ad3cc9dc9746b8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width