Adding comparison for python closure