gratuitous new features in 2.0

Johann Hibschman johann at physics.berkeley.edu
Mon Aug 28 18:25:22 EDT 2000


Tim Peters writes:

> [Grant Griffin]

>> *BTW, what's wrong with ">" for redirect?  Heck, anything that both DOS
>> and Unix do can't be _all_ bad! <wink>

> To both Unix and DOS users, ">" implies overwrite and ">>" implies append.
> The print semantics are much closer to the latter.  Ditto to the meaning of
> ">>" in C++ in an output context.  Using ">" instead would *really* be
> gratuitous novelty.

True, ">" implies overwrite in sh, but I at least think of it as the
more general "send this stuff to this place" operator, since I'm
rarely appending to files.  I suspect this is fairly normal.

sh needs ">>" to distinguish append from the normal overwrite; python
print is clearly not overwriting anything, so we can use the simpler
default of ">".

It's also much less visually heavy than ">>", and I think this basic
prettiness outweighs the analogy to sh.  (Although '->' is nifty,
too!)

--J

-- 
Johann Hibschman                           johann at physics.berkeley.edu



More information about the Python-list mailing list