From d86020ac4f6379fa14e1086b1d28e9e080c2a934 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 10 May 2014 02:03:43 +0300 Subject: 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. --- tests/basics/subclass-native5.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/basics/subclass-native5.py (limited to 'tests/basics/subclass-native5.py') diff --git a/tests/basics/subclass-native5.py b/tests/basics/subclass-native5.py new file mode 100644 index 000000000..6127dae33 --- /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() -- cgit v1.2.3