breakpoint() calls and import of breakpoint from builtins will trigger warnings when running under Python 3.7 or above.
However, this also include calls to user-defined functions named "breakpoint" that shadow the builtin. It could be nice if the following snippet did not trigger a warning, but with the current implementation, it does:
def breakpoint():
pass
breakpoint()
That said, this is also the case for unorthodox redefinitions of pdb or set_trace. While it could be argued that shadowing breakpoint is more likely than shadowing pdb, I still think that this change is worth to be released as is, since it should cover the vast majority of "regular" uses of breakpoint.
The
breakpoint
builtin function has been introduced in Python 3.7: https://docs.python.org/3/whatsnew/3.7.html#pep-553-built-in-breakpointbreakpoint()
calls and import ofbreakpoint
frombuiltins
will trigger warnings when running under Python 3.7 or above.However, this also include calls to user-defined functions named "breakpoint" that shadow the builtin. It could be nice if the following snippet did not trigger a warning, but with the current implementation, it does:
That said, this is also the case for unorthodox redefinitions of
pdb
orset_trace
. While it could be argued that shadowingbreakpoint
is more likely than shadowingpdb
, I still think that this change is worth to be released as is, since it should cover the vast majority of "regular" uses ofbreakpoint
.Closes #12