You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
warnings.deprecated has no skip_file_prefixes #156929
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
Activity
JelleZijlstra commentedon Sep 4, 2026
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.pythongh-156929: Add skip_file_prefixes parameter to warnings.deprecated