4 ms·
A while back I wrote a little test snippet[1] to see how good such an interface can get in python. _("ls -la") | _(lambda x: x.split()[-1]) | _(lambda x: o
by Goopplesoft 9y ago
A while back I wrote a little test snippet[1] to see how good such an interface can get in python.
_("ls -la") | _(lambda x: x.split()[-1]) | _(lambda x: os.path.splitext(x)[1])
I wonder if there's a complete version of something like this out there. You can probably get pretty far staying in Python-land, plus, everything else is free (data types, standard library, adoption, etc).
[1] https://gist.github.com/pnegahdar/726cf2c65fc561db7831 https://gist.github.com/pnegahdar/726cf2c65fc561db7831
- rollcat 9y agoTry playing with __getattr__, I'm sure "_.method" instead of "_(lambda x: x.method())" could be a thing.