summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/class_super_object.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-21 22:24:36 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-21 22:27:03 +0300
commita8408a8abe83c98af50821f1eb1df53cf9d202dd (patch)
tree3d5bc6e17840b26685505d8e306fb1d59c6bbc99 /tests/basics/class_super_object.py
parent6a410789b8ff085baf304fdd3bef2bae6e1377fe (diff)
downloadmicropython-a8408a8abe83c98af50821f1eb1df53cf9d202dd.tar.gz
micropython-a8408a8abe83c98af50821f1eb1df53cf9d202dd.zip
objtype: super: Fall back to "object" lookup as last resort.
Also, define object.__init__() (semantically empty, purely CPython compat measure). Addresses #520.
Diffstat (limited to 'tests/basics/class_super_object.py')
-rw-r--r--tests/basics/class_super_object.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/basics/class_super_object.py b/tests/basics/class_super_object.py
new file mode 100644
index 0000000000..21b97328ea
--- /dev/null
+++ b/tests/basics/class_super_object.py
@@ -0,0 +1,15 @@
+# Calling object.__init__() via super().__init__
+
+class Test(object):
+ def __init__(self):
+ super().__init__()
+ print("Test.__init__")
+
+t = Test()
+
+class Test2:
+ def __init__(self):
+ super().__init__()
+ print("Test2.__init__")
+
+t = Test2()