templates in python c api