Python code should be robot independent. All robot specific stuff should be implemented in the Cpp part. To do so one has to remove the assumption of 7 joints and make the type run time dependend on the underlying robot implementation.