mahmoud / glom

☄️ Python's nested data operator (and CLI), for all your declarative restructuring needs. Got data? Glom it! ☄️
https://glom.readthedocs.io
Other
1.89k stars 61 forks source link

Should Ref() freeze mode at glomtime? #197

Open mahmoud opened 4 years ago

mahmoud commented 4 years ago

It's easy to change mode, then swing back around when referencing the Ref() and now we're glomming that Ref() with a new mode, causing issues. Currently solved like this: https://github.com/mahmoud/glom/pull/196/files#diff-ef0db10c99b24c597e546561d07e34bbR211

kurtbrose commented 3 years ago

put this here to keep track while we were in the middle of another discussion

my view is unless there is a really compelling idiom enabled, we should follow a principal of "least complex behavior" for specs -- keep them as small orthogonal building blocks

(this came up in the context of arg-mode; creating the notion of a "minor mode" that evaporates every time it hits a non-data-structure resolved this form a different direction)