top | item 16279848

(no title)

Goopplesoft | 8 years 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

discuss

order

rollcat|8 years ago

Try playing with __getattr__, I'm sure "_.method" instead of "_(lambda x: x.method())" could be a thing.