hashcollision wrote:
>>From PEP 3116: "BufferedRandom implementation is for all random-access
> objects, whether they are read-only, write-only, or *read-write*."
> (emphasis mine) However, from the pseudo-code for open(),
> "if reading + writing + appending > 1:
> raise ValueError("can't have read/write/append mode at once")"
> dosn't this contradict each other? Why isn't read + write allowed when
> BufferedRandom does allow it? Java's RandomAccessFile allows the mode
> "rw". Is there a way to do something like it in Python?
In Python we have "r+" or "w+". r+ opens a file for reading but also
allows writing. w+ creates or truncates a file and allows reading and
writing. In the open function it's called "updating".
Christian
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com