Skip to content

Instantly share code, notes, and snippets.

@erikbgithub
Created August 10, 2012 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikbgithub/3312908 to your computer and use it in GitHub Desktop.
Save erikbgithub/3312908 to your computer and use it in GitHub Desktop.
#anstelle von
def was_anderes(self):
if not hasattr(self,'variable'):
self.variable = new_variable()
#glaube ich, dass folgendes besser wäre:
def __init__(self):
self.variable = None
[...]
def was_anderes(self):
if not self.variable:
self.variable = new_variable()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment