Title: `warnings.deprecated` has no `skip_file_prefixes` · Issue #156929 · python/cpython · GitHub
Open Graph Title: `warnings.deprecated` has no `skip_file_prefixes` · Issue #156929 · python/cpython
X Title: `warnings.deprecated` has no `skip_file_prefixes` · Issue #156929 · python/cpython
Description: Feature or enhancement Proposal: Seems like when adding warnings.deprecated in #104004, it was forgotten to add one of the two stack skipping arguments. It needs it for the same reasons why it already got stacklevel, e.g. because adding ...
Open Graph Description: Feature or enhancement Proposal: Seems like when adding warnings.deprecated in #104004, it was forgotten to add one of the two stack skipping arguments. It needs it for the same reasons why it alre...
X Description: Feature or enhancement Proposal: Seems like when adding warnings.deprecated in #104004, it was forgotten to add one of the two stack skipping arguments. It needs it for the same reasons why it alre...
Opengraph URL: https://github.com/python/cpython/issues/156929
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`warnings.deprecated` has no `skip_file_prefixes`","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nSeems like when adding `warnings.deprecated` in https://github.com/python/cpython/pull/104004, it was forgotten to add one of the two stack skipping arguments.\n\nIt needs it for the same reasons why it already got `stacklevel`, e.g. because adding decorators adds stack levels in a hard to predict way (e.g. a 3rd party decorator might start calling the wrapped function one level deeper, suddenly changing where the warning points)\n\n### Has this already been discussed elsewhere?\n\nYes, and it was accepted, but then apparently fogotten, see link below\n\ncc @brettcannon @JelleZijlstra \n\n### Links to previous discussion of this feature:\n\nhttps://discuss.python.org/t/pep-702-marking-deprecations-using-the-type-system/23036/11\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-156937\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/flying-sheep","@type":"Person","name":"flying-sheep"},"datePublished":"2026-09-04T11:27:43Z","url":"https://github.com/python/cpython/issues/156929"}
| 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:6f3aa3b2-4965-f353-5d80-f2a5ae4d8277 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA82:116138:35578E:444931:6AFF89E1 |
| html-safe-nonce | 4bae9dc033c6f1bc3d793824451fe1a67a821841af3d86c598244972f59d3384 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTgyOjExNjEzODozNTU3OEU6NDQ0OTMxOjZBRkY4OUUxIiwidmlzaXRvcl9pZCI6IjgxNzQzMzkxNTI5MTM4NjEwODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | dc0bce2c320ff957439ffefc7fcd5815b780f1aab9bb8a4fdf1455cd027ccac0 |
| hovercard-subject-tag | issue:5347520920 |
| 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/156929/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1b3689fc87ffd4ac73d4897033c92a96e20a1f9041ba96ba6c07f0f183e94cd5/python/cpython/issues/156929 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1b3689fc87ffd4ac73d4897033c92a96e20a1f9041ba96ba6c07f0f183e94cd5/python/cpython/issues/156929 |
| og:image:alt | Feature or enhancement Proposal: Seems like when adding warnings.deprecated in #104004, it was forgotten to add one of the two stack skipping arguments. It needs it for the same reasons why it alre... |
| 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 | 587ad99a3e443b2e1cb0d3df059ec49ab54389861f13310766dfdeb615fed90d |
| 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 | 5bb0fb68d64881d1344f5863d809515d496801e5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width