Use Ellipsis!
For quick breakpoints or something that make minimum visual impact to you code, you may insert and break on an ... (Ellipsis):
For example:
while some_condition():
do_something()
... # <<< set break point here!
this may the most clean way towards me.
Some background
Ellipsis is a special built-in python object mainly for Slice notating. Here I (ab)use it to do something else. See: What does the Python Ellipsis object do?
It is OK to insert a bare integer, variable name or something into code to set break point on certain place, but it may look odd and clutter your code, but ... is visually harmless. Compare with this:
break_point = 0
while some_condition():
do_something()
break_point # <<< set break point here!
or this:
while some_condition():
do_something()
if False: # <<< set break point here!
pass
some other tricks tested:
del [] # works(with warning: "cannot assign to []")
[] # works(with warning: Statement seems to have no effect)
setbreakpoint = 1 # works(with warning: "local variable value is not used")
Ellipsis # works(with warning: Statement seems to have no effect)
another interesting thing that happens to me is, when i set breakpoints on pass it may or may not break, depending to its location in code, but the exact rule for break or not is somehow unclear.
i, which is valid python but doesn't do anything). This has the added benefit of being picked up by pylint so I don't accidentally commit it.passmeans do nothing, and doing nothing is decided while compiling, so there is no executable code atpass, and finally debugger cannot debugnothing.if <condition here>: passif you add break to the pass, the sentence would be executed only if the condition is true.