Skip to content

warnings.deprecated has no skip_file_prefixes #156929

Description

@flying-sheep

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

Activity

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 dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions