Skip to content

Instantly share code, notes, and snippets.

@mushfiq
Last active December 20, 2015 15:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mushfiq/6152195 to your computer and use it in GitHub Desktop.
Save mushfiq/6152195 to your computer and use it in GitHub Desktop.
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