Since Python 3.7 this particular warning is not shown by default, unless triggered directly in __main__ (or the -W argument is set on the interpreter)
Calls to warnings.warn() display their own lines, which defeats the purpose of DeprecationWarning - the stacklevel exists for that, pointing one level down to the plugin function calling them.
Type of Change
A convenience for plugin developers which would otherwise miss that they are using deprecated functions.
How Tested
Running the latest version of some plugins showed immediate results - the use of myNotebook.Label being particularly common.
Description
Our use of
DeprecationWarning
falls into two traps described in thewarnings
library documentation:__main__
(or the-W
argument is set on the interpreter)warnings.warn()
display their own lines, which defeats the purpose ofDeprecationWarning
- thestacklevel
exists for that, pointing one level down to the plugin function calling them.Type of Change
A convenience for plugin developers which would otherwise miss that they are using deprecated functions.
How Tested
Running the latest version of some plugins showed immediate results - the use of
myNotebook.Label
being particularly common.Notes