Description of feature
One idea I had: the default of FutureWarning across the board is good for our usual use case (=libraries that are usually used directly and not by other libraries), but it’s inconvenient to override, as you’d want to override it on a (toplevel import or distribution) package level.
I wonder if we could introduce a new default for the category args. If we at any point introduce a non-declarative API that raises a warning, we could also use that to set the default skip_file_prefixes.
E.g. directly in the body of the function, this would get the caller module name: inspect.getmodule(inspect.stack()[1].frame).__name__
The only issue would be if anyone wraps our decorator, as that would mean the call site is wherever the wrapper is defined.
Description of feature
One idea I had: the default of
FutureWarningacross the board is good for our usual use case (=libraries that are usually used directly and not by other libraries), but it’s inconvenient to override, as you’d want to override it on a (toplevel import or distribution) package level.I wonder if we could introduce a new default for the
categoryargs. If we at any point introduce a non-declarative API that raises a warning, we could also use that to set the defaultskip_file_prefixes.E.g. directly in the body of the function, this would get the caller module name:
inspect.getmodule(inspect.stack()[1].frame).__name__The only issue would be if anyone wraps our decorator, as that would mean the call site is wherever the wrapper is defined.