4 ms·
One of the most useful trick I found was installing the tool via sitecustomize.py so you don't need the import: # add devtools debug to builtins try:
by scolvin 6y ago
One of the most useful trick I found was installing the tool via sitecustomize.py so you don't need the import:
# add devtools debug to builtins
try:
from devtools import debug
except ImportError:
pass
else:
__builtins__['debug'] = debug
(see https://github.com/samuelcolvin/python-devtools#usage-without-import https://github.com/samuelcolvin/python-devtools#usage-withou...)
This would work with icecream too.
The second advantage of not needing the import is that CI fails if you forget to remove all debug() commands.