Skip to content

Instantly share code, notes, and snippets.

@sodastsai
Last active September 27, 2017 13:08
Show Gist options
  • Save sodastsai/221d9ca1ef69aec50a0f46886b9cb81b to your computer and use it in GitHub Desktop.
Save sodastsai/221d9ca1ef69aec50a0f46886b9cb81b to your computer and use it in GitHub Desktop.
called = False
class Stoppable:
def stop(self):
print("Stopped")
def sad():
global called
if not called:
called = True
return True
return Stoppable()
if sad():
sad().stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment