3 ms·
In Python I use a small collection of built-ins frequently for debugging: For any object foo: type(foo) # show an object's type dir(foo) # li
by tedmiston 11y ago
In Python I use a small collection of built-ins frequently for debugging:
For any object foo:
type(foo) # show an object's type
dir(foo) # list an object's methods
help(foo) # pydoc
id(foo) # show an object's memory address
foo.__dict__ # show an object's internal data structure
And I have a snippet triggered by "pdb<tab>" for pdb:
import pdb ; pdb.set_trace()