small optimise on python statement