-
-
Save robertwb/c171444f53a2dd55787a38186d4b1e45 to your computer and use it in GitHub Desktop.
Test python import
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
| print "defining A" | |
| class A(object): | |
| def __init__(): | |
| print 'A' |
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
| from a import A | |
| print "defining B" | |
| class B(A): | |
| def __init__(): | |
| print 'B' | |
| import c |
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
| from a import A | |
| print "defining C" | |
| class C(A): | |
| def __init__(): | |
| print 'C' |
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
| from a import A | |
| print A.__subclasses__() | |
| # [] | |
| import b | |
| # defining B | |
| # defining C | |
| print A.__subclasses__() | |
| # [<class 'b.B'>, <class 'c.C'>] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment