Skip to content

Instantly share code, notes, and snippets.

@FND
Created June 9, 2009 16:20
Show Gist options
  • Select an option

  • Save FND/126604 to your computer and use it in GitHub Desktop.

Select an option

Save FND/126604 to your computer and use it in GitHub Desktop.
import foo
class Bar(object):
def __init__(self):
print "in bar.Bar.init"
def run(self, msg):
print "in bar.Bar.exec", msg
def bar(msg):
print "in bar.bar", msg
foo.Foo = Bar
foo.foo = bar
import foo
class Baz(foo.Foo):
def __init__(self):
print "in baz.Baz.init"
def run(self, msg):
print "in baz.Baz.exec", msg
def baz(msg):
print "in baz.baz", msg
class Foo(object):
def __init__(self):
print "in foo.Foo.init"
def run(self, msg):
print "in foo.Foo.exec", msg
def foo(msg):
print "in foo.foo", msg
def test():
i = foo.Foo()
i.run("hello")
foo.foo("world")
print "importing foo"
import foo
test()
print "importing bar"
import bar
test()
print "importing baz"
import baz
test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment