Last active
September 27, 2017 13:08
-
-
Save sodastsai/221d9ca1ef69aec50a0f46886b9cb81b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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