Improve handling of '=' char in python