-
-
Save pirsquared/c7ac03ad107857f01c5c3238fcc9885e to your computer and use it in GitHub Desktop.
This file contains 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
# Create an instance of Bomb without crashing the program. | |
# Monkeypatching __init__ is not allowed. | |
class Bomb: | |
def __init__(self): | |
raise RuntimeError('BOOM') | |
bomb = Bomb.__new__(Bomb) # YOUR CODE HERE | |
assert type(bomb) is Bomb, "You didn't create a Bomb instance, did you?" | |
print('You win!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment