Created
March 2, 2015 07:48
-
-
Save gtt116/de2ec00cdcc07626ab50 to your computer and use it in GitHub Desktop.
python weird codes
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
""" | |
Why line 21 raise ?? | |
""" | |
def error(): | |
print 'foo' | |
class OK(object): | |
pass | |
class Hehe(): | |
impl_ok = OK | |
impl_err = error | |
def __init__(self): | |
self.implement = self.__class__.impl_ok() | |
print self.implement | |
self.implement = self.__class__.impl_err() | |
print self.implement | |
he = Hehe() |
Author
gtt116
commented
Mar 2, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment