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
I have yet to come across a usecase where stacklevel=1 makes sense -- usually it is more helpful to point at the calling code than the function which is itself warning
my proposal is to update the default for stacklevel= from 1 to 2
an example bpo where this is relevant is bpo-44295
stacklevel is also often not a great API as it's an integer that depends on a pile of calling code far from the warnings.warn call itself. #39615 is likely to provide a more useful API. check the module/file of the stack frame and bubble up outside of the current file/module/package or a set of such.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: