Monthly Shaarli

All links of one month in a single page.

November, 2021

Tips for debugging with print() - Adam Johnson

Quelques tips pour debugger du code python avec print(), notamment:

  • Debug variables with f-strings and =: print(f"{myvar=}")
  • Use locals() to debug all local variables: print(locals())
  • Use vars() to debug all of an object’s attributes: print(vars(myobject))