From b5ece95c18e36e5bb6c4e2549db4c40e71a954e0 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Mon, 21 Nov 2016 14:40:50 +0100 Subject: [PATCH] python: derive all classes from 'object' This increases consistency with Python 3. Specifically, for classes derived from object, Python 2 uses the same method resolution algorithm that is used by Python 3. As the Python 3 algorithm is more strict, ensuring the use of this algorithm already in Python 2 will make sure Python 3 support is not regressed by accident by creating a class hierarchy that does not provide monotonicity. Signed-off-by: Tobias Grosser Signed-off-by: Sven Verdoolaege --- interface/python.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/python.cc b/interface/python.cc index db644898..c32ca3fb 100644 --- a/interface/python.cc +++ b/interface/python.cc @@ -722,6 +722,8 @@ static void print_class_header(const string &name, const vector &super) printf("%s", type2python(super[i]).c_str()); } printf(")"); + } else { + printf("(object)"); } printf(":\n"); } -- 2.11.4.GIT