Title: How should we add `@deprecated` to objects in the standard library? · Issue #11002 · python/typeshed · GitHub
Open Graph Title: How should we add `@deprecated` to objects in the standard library? · Issue #11002 · python/typeshed
X Title: How should we add `@deprecated` to objects in the standard library? · Issue #11002 · python/typeshed
Description: If an object is deprecated in Python 3.12, to be removed in Python 3.14, should we decorate it like this? (1) @deprecated("Will be removed in Python 3.14") class Foo: ... Like this? (2) @deprecated("Deprecated in Python 3.12; will be rem...
Open Graph Description: If an object is deprecated in Python 3.12, to be removed in Python 3.14, should we decorate it like this? (1) @deprecated("Will be removed in Python 3.14") class Foo: ... Like this? (2) @deprecated...
X Description: If an object is deprecated in Python 3.12, to be removed in Python 3.14, should we decorate it like this? (1) @deprecated("Will be removed in Python 3.14") class Foo: ... Like this? (2) @...
Opengraph URL: https://github.com/python/typeshed/issues/11002
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How should we add `@deprecated` to objects in the standard library?","articleBody":"If an object is deprecated in Python 3.12, to be removed in Python 3.14, should we decorate it like this? (1)\r\n\r\n```py\r\n@deprecated(\"Will be removed in Python 3.14\")\r\nclass Foo: ...\r\n```\r\n\r\nLike this? (2)\r\n\r\n```py\r\n@deprecated(\"Deprecated in Python 3.12; will be removed in Python 3.14\")\r\nclass Foo: ...\r\n```\r\n\r\nOr like this? (3)\r\n\r\n```py\r\nif sys.version_info >= (3, 12):\r\n @deprecated(\"Will be removed in Python 3.14\")\r\n class Foo: ...\r\nelse:\r\n class Foo: ...\r\n```\r\n\r\nFor somebody who uses Python 3.8, it might be surprising if a type checker started emitting warnings about an object being deprecated if the runtime only emits a `DeprecationWarning` on Python 3.12+. For that user, Python 3.14 will be a long way away; they might not even be _able_ to switch to the newer way of doing things yet (perhaps the \"replacement idiom\" only exists on Python 3.9+). For us in typeshed, however, (3) is obviously the most tedious option for us to maintain, as it will mean more branches.\r\n\r\nThoughts?","author":{"url":"https://github.com/AlexWaygood","@type":"Person","name":"AlexWaygood"},"datePublished":"2023-11-09T15:45:04Z","url":"https://github.com/python/typeshed/issues/11002"}
| 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:f8cc5cf0-daf1-39c5-e43e-33c9987a3f24 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A060:2261EB:1CB859:253054:6AFFB2A6 |
| html-safe-nonce | b24445f4991e57d207ae6490fa18a52095b660bf899f20e57140c2051d8dd71f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDYwOjIyNjFFQjoxQ0I4NTk6MjUzMDU0OjZBRkZCMkE2IiwidmlzaXRvcl9pZCI6IjMyNjE2NjcwMzA4NTk1Nzc5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 31c1d1fc01dae005068ceb131ff03895ffd85484665c7ff9f8e584ab786e2595 |
| hovercard-subject-tag | issue:1985911602 |
| 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/typeshed/11002/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e4f72925f033dc322f7d9a85e4c5a50ca99986305ab41118d09bbeecf99848b0/python/typeshed/issues/11002 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e4f72925f033dc322f7d9a85e4c5a50ca99986305ab41118d09bbeecf99848b0/python/typeshed/issues/11002 |
| og:image:alt | If an object is deprecated in Python 3.12, to be removed in Python 3.14, should we decorate it like this? (1) @deprecated("Will be removed in Python 3.14") class Foo: ... Like this? (2) @deprecated... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AlexWaygood |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0cfbaed33b1bdb4acc1759cf1f9961081735b46e22e30a787492e9eeb3019ca2 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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 | 4992f08cc0d7b67d9895cb99b8e0e36c6493ee78 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width