Python: Update api and avoid compiler warning by using {}

Jørgen Lind requested to merge feature/jorgen.lind/python into master

in if expressions

Merge request reports