An approach to constraint solving in python