Skip to content

Instantly share code, notes, and snippets.

@elsonidoq
Created May 2, 2014 17:54
Show Gist options
  • Save elsonidoq/0cd2823ea53affada7c9 to your computer and use it in GitHub Desktop.
Save elsonidoq/0cd2823ea53affada7c9 to your computer and use it in GitHub Desktop.
Why safe_write is useful?
with safe_write('delete_me') as f:
f.write('some contents')
with safe_write('delete_me') as f:
1/0
# delete_me contents still are "some contents"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment