Created
March 22, 2016 11:18
-
-
Save drj11/5661d45da6268d856ea0 to your computer and use it in GitHub Desktop.
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 __future__ import print_function | |
class S(): | |
_ = print("executing class S") | |
x = 1 | |
y = x | |
print("S.y", S.y) | |
try: | |
class A(S): | |
_ = print("executing class A") | |
y = x | |
except NameError: | |
pass | |
try: | |
A | |
except NameError: | |
print("A is not defined; as expected") | |
else: | |
assert not "A is defined" | |
class B(S): | |
_ = print("executing class B") | |
print("B.y", B.y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment