. Python 2.1 function attributes

Mitch Chapman chapman at bioreason.com
Mon Jan 29 11:10:01 EST 2001


Here's hoping I got the attribution right.

Tim Peters wrote:
> 
> [Alex Martelli]
> > d. he thought print>>file would APPEND to the file object and never
> >     OVERWRITE it
> 
> Well, print>> does append, unless he explicitly seek()'ed to an earlier file
> position between prints.
> 
> > -- at least once tried writing 'print>file' for the latter purpose
> 
> [...]That is, it isn't so clear *where* he got confused.

It might be clearer if we could assume he's spent time with
(Unix?) command shells.  ">" overwrites files, ">>" appends.  
More evidence for this suspicion:

> >  -- and I also heard him complain than then 'of course' input<file
> >     should also work.

My expectations for Python's behavior have rarely been
influenced by experience with other shells, but it has happened.
For example, it took a few years to stop typing "exit" or "quit"
to get out of the interpreter; and now that I've finally
learned, I find myself exiting all of the other interpreters --
bash, mysql, you name it -- by typing Ctrl-D.

--
Mitch
chapman at bioreason.com



More information about the Python-list mailing list