-
-
Save sb2nov/52b5091fcc7135bcd02948088d876d5b to your computer and use it in GitHub Desktop.
Test python import
This file contains 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 A(object): | |
def __init__(): | |
print 'A' |
This file contains 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 | |
class B(A): | |
def __init__(): | |
print 'B' |
This file contains 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 | |
class C(A): | |
def __init__(): | |
print 'C' |
This file contains 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__() | |
# [] | |
from b import B | |
print A.__subclasses__() | |
# [<class 'b.B'>] | |
from c import 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
The user must cause this to be imported to indicate that they want to use it. (Perhaps directly, perhaps some runners will import certain filesystems themselves.)