python interface: add type check to __str__ methods
commitf0dc13a789da91dcf90cdfabd8081939cba61f5d
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 1 Jul 2016 14:35:20 +0000 (1 16:35 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 1 Jul 2016 15:17:04 +0000 (1 17:17 +0200)
tree2c60770df738b716bf72468ddc706c7ee38bfe4f
parent400ac547d7a3489e8916d8b8146ac34925583096
python interface: add type check to __str__ methods

Currently, all classes have a __str__ method, but the next commit
makes this optional.  It will then be possible for a subclass
to not have a __str__ method while its superclass does have one.
Calling the method on an object of the subclass will then end up
calling the method of the superclass.  This method therefore
needs to check that its argument is of the correct type before
calling the corresponding *_to_str function.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
interface/python.cc