hindley milner type-inference in python