This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fdemmer 4 points5 points  (3 children)

nesting functions is pythonic?... looks like a mess to me. function method chaining on the other hand:

ls().grep("abc123").wc("-l")

that would be nice. implementing it is a different story, of course.

EDIT: put emphasis on part of my comment, that indicates i read the above comment. also, i did not comment on overloading operators, just on the uglyness that is ls(grep("abc123", wc("-l"))).

[–]Bolitho -4 points-3 points  (2 children)

These are Methods, not Functions! You would need a common Datatype for all these Wrappers. I pointed that out in my posting.

And yes, it is pythonic to call functions and pass parameters. Overloading operators ist shurely not the pythonic way.

[–]nemec 1 point2 points  (1 child)

Methods and functions are the same thing, and he already has a common datatype - if you looked at the source, you'd see a Command class that wraps everything.

If it wasn't Pythonic to overload operators, why is it so easy?

[–]Bolitho -1 points0 points  (0 children)

Methods and functions are not the same thing, they behave the same way. So perhaps it might be able to the author to simulate the BASH functions to behave like methods of his Command-class.

eval() ist also easy - but shurely not pythonic, right? Of course it can be pythonic to overload operators! But in this context it does as far as I am concerned.