[Patches] fileinput.py argument handling (and suggestion)

Greg Stein gstein@lyra.org
Sat, 8 Apr 2000 05:05:30 -0700 (PDT)


On Wed, 5 Apr 2000, Guido van Rossum wrote:
> I kind of like the chop switch.  Anybody else got an opinion?
> 
> +1

+1 here, too. I usually find it a pain to worry about that darn newline.

I might go one further, and ask for a way to *strip* the line, rather than
just take the newline off the end. I can't think of a clean way to do so.
For example:

  fileinput.input()
  fileinput.input(strip=fileinput.STRIP_NL)
  fileinput.input(strip=fileinput.STRIP_ALL)

It just seems a bit wordy, especially compared to the "chop=1" thing.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/