PRE-PEP: new Path class
Jp Calderone
exarkun at intarweb.us
Wed Jan 7 20:04:23 EST 2004
On Thu, Jan 08, 2004 at 12:11:05AM +0100, Christoph Becker-Freyseng wrote:
> [snip]
>
> openwith would be a nice add-on. I see two problems with it:
> 1.) it's long. I mean
> f(str(path), *args)
> is shorter than
> path.openwith(f, *args)
> I got an idea of shortening this and making it look a bit like shell
> (I'm not convinced of it very much, but I didn't want to keep it secret
> --- maybe others like it ...)
>
> path > (f, arg1, arg2, ...)
>
> (this works by overwriting path.__gt__)
You shoulda kept it secret. That's horrible. If you're going to override
a piece of syntax for this, I think nothing makes as much sense as __call__
(but I don't think that makes much sense either).
Jp
More information about the Python-list
mailing list