Last active
January 17, 2016 17:09
-
-
Save aflag/2a04378053f79ec8d3ef 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
class Foo(object): | |
def __init__(self): | |
self._x = 0 | |
@property | |
def x(self): | |
return 1 / self._x | |
try: | |
if hasattr(Foo(), 'x'): | |
print('Yes!') | |
else: | |
print('No!') | |
except: | |
print('wat?') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment