[I might throw this one out. Scroll down for the orif idea]
Sometimes when you're coding you end up with things like this:
if x:
# block 1
if y:
# block 2
else:
# block 3
else:
# block 3 (same as above)
What if you could instead do:
if x:
# block 1
andif y:
# (has to be last statement in a block / must come immediately before an `else` (either implicit or explicit i.e. you can chain it))
# block 2
# implicit else that saves both:
# a) bytecode size (in some rare circumstances, this can lead to faster execution)
# b) code size (less bloat/easier to read)
else:
# block 3
(Obviously the comments made it bigger than the other code >.> but comments != code so it's all good)
What if you want an elif?
Doing:
if x:
# block 1
andif y:
# block 2
elif z:
# block 3
else:
# block 4
Would be semantically equivalent to:
if x:
# block 1
if y:
# block 2
elif z:
# block 3
else:
# block 4
else:
# block 4