Better HN
topnewbestaskshowjobs
Log inSign up

doublereedkurt

5 karma · joined May 2, 2013 (13y ago) · 3 submissions

Submissions

comment 8y ago · link · parent

http://glom.readthedocs.io/en/latest/api.html#debugging

affordances to add tracing prints, or drop into a pdb at any level

The Inspect specifier type provides a way to get visibility into glom’s evaluation of a specification, enabling debugging of those tricky problems that may arise with unexpected data.

Inspect can be inserted into an existing spec in one of two ways. First, as a wrapper around the spec in question, or second, as an argument-less placeholder wherever a spec could be.

Inspect supports several modes, controlled by keyword arguments. Its default, no-argument mode, simply echos the state of the glom at the point where it appears:

comment 8y ago · link · parent

a nice __repr__ is the main thing

comment 8y ago · link · parent

'string-key', T['string-key'], T[not-string-key] :-)