python interface: only export __str__ and __repr__ if *_to_str is declared
commit4f1364d9aa2715a1527d3ff048a7cf89bc99f177
authorTobias Grosser <tobias@grosser.es>
Thu, 30 Jun 2016 14:22:35 +0000 (30 16:22 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 1 Jul 2016 15:21:13 +0000 (1 17:21 +0200)
tree5ec11394735334e0be00f4c6b334204bc18e6715
parentf0dc13a789da91dcf90cdfabd8081939cba61f5d
python interface: only export __str__ and __repr__ if *_to_str is declared

Instead of plainly assuming to_str always exists, we now only export
__str__ and __repr__ in case *_to_str is declared in the public header
files.  At this point all exported classes have a *_to_str function, but
ast_build does not have _to_str and there are no concrete plans to add
such an interface.  To still be able to generate types for classes
without *_to_str, we remove the dependency on its existence.

Signed-off-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
interface/extract_interface.cc
interface/python.cc
interface/python.h