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

don't treat classes with glomit() methods as specs -- only instances #184

Closed kurtbrose closed 4 years ago

kurtbrose commented 4 years ago

image

in _glom() ^

this would allow Match based meta-glom to refer to spec types directly instead of lambda t: isinstance(t, SpecType)

kurtbrose commented 4 years ago

oh whoops I guess the alternative is really Check(type=SpecType)

mahmoud commented 4 years ago

So really limit it down to bound methods? Ignore callable attributes and class/static methods? I guess that follows Python builtin operator overloading / data model stuff.

kurtbrose commented 4 years ago

whoops didn't mean to say disallow those others -- more if it is an unbound method that is obviously gonna instantly fail

the goal is just to make spec types work in match for meta glom :-)

On Wed, Aug 5, 2020 at 11:43 PM Mahmoud Hashemi notifications@github.com wrote:

So really limit it down to bound methods? Ignore callable attributes and class/static methods? I guess that follows Python builtin operator overloading / data model stuff.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mahmoud/glom/issues/184#issuecomment-669737035, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEEZPTIOYMWQDXKW7LXUM3R7JGHHANCNFSM4PV3HMEQ .