[Python-ideas] `to_file()` method for strings

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Mar 23 18:30:31 EDT 2016


On Wed, Mar 23, 2016 at 6:20 PM, Sven R. Kunze <srkunze at mail.de> wrote:

>
> bash:  echo "my string" >> my_file
> python: with open('my_file', 'w') as f: f.write('my string')

...

>
> I can tell you from my experience with several aged Python developers that
> they regularly fail to implement atomic file operations. Just saying.


What make you think your bash example implements an atomic write?  It
actually performs an append and therefore not equivalent to the python code
that followed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160323/75b392c1/attachment.html>


More information about the Python-ideas mailing list