Last active
December 20, 2015 15:09
-
-
Save mushfiq/6152195 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
class Ladder(object): | |
def __init__(self): | |
self.hight = 20 | |
class Table(object): | |
def __init__(self): | |
self.legs = 4 | |
my_factory = { | |
"target1": Ladder, | |
"target2": Table, | |
} | |
if __name__ == '__main__': | |
print my_factory ["target1"]().hight | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment