Swig binding: fix Rational

Also generate auto-doc for python.