Results 190 comments of Kurt Rose

the actual use case was cleaning up some sloppy input that might be a dict, or a list of dicts looking for user.client ```python context = [{}, {}, {'user': {'client':...

practical use case of macro -- adding defaults to a dictionary before validation ```python >>> glom({'optional': 'val'}, (Fill([T, Literal(T)]), lambda t: Fill(t), lambda t: Merge(t))) Merge(Fill([{'optional': 'val'}, T]), init=, op=)...

for comparison, here is the non-marco version ```python # no macro lambda defaults: Merge(Fill([defaults, T])) # macro lambda defaults: glom(defaults, (Fill([T, Literal(T)]), Fill, Merge)) ```

another practical use case -- and this works too transform a django database configuration to a tableau REST api connection + datasource object ```python _BUILDER2ASSIGNER = Spec(( Let(type=T[1]), T[0].items(), [Invoke(Assign).specs(...

alright, some real meta-glomming happening one thing has become clear: for large-scale meta-glom to work well, it needs to be possible to determine the mode statically this means one of...

pytest is green locally which took a couple of hours of fiddling We do need at a minimum a continue construct; I thought that could be reconciled with SKIP but...

yup, 100% these should have the same semantics as BadSpec -- if they are uncaught that is like having a break outside of a loop in python; syntax error

this may also dovetail into "breadcrumbs" / branching if we want SKIP and STOP to be handled more centrally by `_glom` dispatching rather than manually one-by-one in each spec, that...

or maybe it could just be a helper function for iterable-specs; basically catch Continue "inside the loop", catch Break "outside the loop" that code pattern is worth abstracting, and by...

the most useful pattern of "SKIP as value" is things like `Check(..., default=SKIP)` or `Coalesce(..., default=SKIP)` one alternative to this would be if default used a new `ArgSpec`, which basically...