GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `warnings.deprecated` has no `skip_file_prefixes` · Issue #156929 · python/cpython

warnings.deprecated has no skip_file_prefixes #156929

New issue
Copy link
New issue
Copy link
Open
Open
warnings.deprecated has no skip_file_prefixes#156929
Copy link
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement

Description

@flying-sheep
flying-sheep
opened on Sep 4, 2026
Issue body actions

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 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)

Has this already been discussed elsewhere?

Yes, and it was accepted, but then apparently fogotten, see link below

cc @brettcannon @JelleZijlstra

Links to previous discussion of this feature:

https://discuss.python.org/t/pep-702-marking-deprecations-using-the-type-system/23036/11

Linked PRs

  • gh-156929: add skip_file_prefixes to warnings.deprecated #156937

Activity

  1. flying-sheep
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Sep 4, 2026
  2. JelleZijlstra commented on Sep 4, 2026

    @JelleZijlstra
    JelleZijlstra
    on Sep 4, 2026
    Member
    More actions

    Good call, PR welcome!

    At this point we should do it only in Python 3.16. We can backport the new parameter to typing_extensions.

  3. picnixz
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on Sep 4, 2026
  4. seth-957
    added a commit that references this issue on Sep 6, 2026

    pythongh-156929: Add skip_file_prefixes parameter to warnings.deprecated

    2a72db1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.