Skip to content

Instantly share code, notes, and snippets.

@DanielSzoska
Created October 9, 2012 07:34
Show Gist options
  • Save DanielSzoska/3857192 to your computer and use it in GitHub Desktop.
Save DanielSzoska/3857192 to your computer and use it in GitHub Desktop.
Auszug aus TextPatcher.__init__
with io.open(..) as f:
# do something
pass
# save the type of newlines
self.newlines = f.newlines
with io.open(..) as f:
# do something
pass
# save the type of newlines
self.newlines = f.newlines
@ctismer
Copy link

ctismer commented Oct 9, 2012

Ist unnoetig. file.newlines ist die History der Datei, und die bleibt auch wenn die Datei geschlossen wird. Nur das Dateiobjekt muss noch existieren, und das tut's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment