Created
June 9, 2009 16:20
-
-
Save FND/126604 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
| 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 |
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
| 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 |
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 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 |
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
| 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