HNHacker News
TopNewBestAskShowJobs

cknd

59 karma · joined August 28, 2015

submissionscomments
cknd··on Icecream – A little debugging library
Two recent discussions about related-though-not-identical Python debugging tools:

https://news.ycombinator.com/item?id=19717786

https://news.ycombinator.com/item?id=19772902

cknd··on Show HN: Debugging-Friendly Tracebacks for Python
I always liked how this automatically hooks into the python installation via pip, but preferred another text format. Hm. So if you want to permanently replace python's crash message, you could put a file `sitecustomize.py` into your python path, with these contents for example:

    # in site-packages/sitecustomize.py:
    print('hello!')
    import sys; sys.excepthook = lambda a,b,c: print('<bomb emoji>')
    # or also:
    import stackprinter
    stackprinter.set_excepthook(style='darkbg')
(you can find the path by `python -c "import site; print(site.PREFIXES)" `)

It felt bit much to do that automatically on installation, but maybe it would be a good option to have

cknd··on PySnooper: Never use print for debugging again
One situation where I would have wanted a real debugger and couldn't use one was in crash reporting on remote systems (like, machine learning code running in some container somewhere, or on a headless box far from the network).

Since Python's built-in tracebacks are pretty minimal, the default crash logs don't offer much help other than a line number. I ended up writing a tool that prints tracebacks along with code context and local variables [i], sort of a souped up version of the built-in crash message. It's surprising how much that already helped in a few situations, makes me wonder why it isn't the default.

So, yes, more debuggers, but also abundant logging everywhere!

[i] https://github.com/cknd/stackprinter

cknd··on Montreal Is Leading the AI World Takeover
yes, let's talk: clemens@<company domain>
cknd··on Montreal Is Leading the AI World Takeover
By pure chance I know one exception to this ad-tech/e-commerce bias in Berlin: I'm at a Berlin-based company[0] working on DL and deep RL for industrial applications (think robots, optimisation and control).

[0] micropsi-industries.com/join_us