[Patches] fileinput.py argument handling (and suggestion)
Moshe Zadka
Moshe Zadka <mzadka@geocities.com>
Sat, 8 Apr 2000 19:16:43 +0200 (IST)
On Sat, 8 Apr 2000, Guido van Rossum wrote:
> fileinput.input(strip=1)?
>
> But I think this is going too far. Next we get
>
> fileinput.input(lower=1)
>
> fileinput.input(split=1)
>
> fileinput.input(split=1, sep=':')
>
> fileinput.input(split=1, sep=':', maxplit=3)
>
> fileinput.input(strip=1, capitalize=1, expandtabs=1)
>
> fileinput.input(startswith="#")
>
> fileinput.input(find="spam")
Hmmmm....I'm sure Python is expressive enough to solve this problem
in a nice way?
How about having the FileInput class documentedy subclassable, and
make available some nice mixins? I'm sure such a scheme could work.
I'll have to think about it some more -- I'm hoping to come up with
something soon.
too-much-time-without-a-cute-design-problem-ly y'rs, Z.
--
Moshe Zadka <mzadka@geocities.com>.
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com