Better HN
topnewbestaskshowjobs
Log inSign up

cknd

59 karma · joined Aug 28, 2015 (11y ago) · 8 submissions

Submissions

comment 7y ago · link · parent

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

comment 7y ago · link · parent

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

3.

Show HN: Debugging-Friendly Tracebacks for Python(github.com ↗)

123 points · by cknd · 7y ago · 12 comments

comment 7y ago · link · parent

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

comment 9y ago · link · parent

yes, let's talk: clemens@<company domain>

comment 9y ago · link · parent

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