Ram Rachum added the comment:

I like the patch. Except I'd like to have support for the 'x' flag in the 
`write_text` and `write_bytes` methods. I suggest an argument `exclusive`, 
which defaults to `False`. When `exclusive=True`, the mode will be 'x' or 'xb'.

The first lines after each method definition should be:

    if append and exclusive:
        raise Exception("Can't use both `append` and `exclusive` modes 
together; `append` implies that the file exists, while `exclusive` implies it 
does not.")

If you don't like long exception texts, you can shorten it to just the first 
sentence. Also, you may want to choose a different exception class than 
`Exception`.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20218>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to