Why no open(f, "w").write()?
Greg Ewing
look at replyto.address.invalid
Thu May 30 01:04:39 EDT 2002
VanL wrote:
>
> Ok, I've read the thread... but how is
>
> open(f, 'w').write(stuff)
>
> different than
>
> lines = open(f).readlines()
In CPython they both work fine. In Jython they could
both leak resources, and when writing there is the
additional possibility of written data not making
it to the file as soon as you'd like.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list