summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-10 02:03:43 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-05-10 16:56:20 +0300
commitd86020ac4f6379fa14e1086b1d28e9e080c2a934 (patch)
tree1b85c7430cf8e9dd8b16c99a0ed6b4b0e331e9b0 /tests/basics
parentd0a5bf34f746276550aef9c8519160c033611571 (diff)
downloadmicropython-d86020ac4f6379fa14e1086b1d28e9e080c2a934.tar.gz
micropython-d86020ac4f6379fa14e1086b1d28e9e080c2a934.zip
objtype: Don't treat inheritance from "object" as from native type.
"object" type in MicroPython currently doesn't implement any methods, and hopefully, we'll try to stay like that for as long as possible. Even if we have to add something eventually, look up from there might be handled in adhoc manner, as last resort (that's not compliant with Python3 MRO, but we're already non-compliant). Hence: 1) no need to spend type trying to lookup anything in object; 2) no need to allocate subobject when explicitly inheriting from object; 3) and having multiple bases inheriting from object is not a case of incompatible multiple inheritance.
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/subclass-native5.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basics/subclass-native5.py b/tests/basics/subclass-native5.py
new file mode 100644
index 0000000000..6127dae33d
--- /dev/null
+++ b/tests/basics/subclass-native5.py
@@ -0,0 +1,12 @@
+# Subclass from 2 bases explicitly subclasses from object
+
+class Base1(object):
+ pass
+
+class Base2(object):
+ pass
+
+class Sub(Base1, Base2):
+ pass
+
+o = Sub()