News for hackers. Stuff that matters.
Re:Ask HN: How do you debug your code? by tedmiston on Saturday April 02, 2016 @05:22PM (#11413525)
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()

There are no comments on this comment yet.