py: Simplify compilation of elif blocks.