updated Python binding to handle constraints and externally supplied reverse indices