In this post, I'll present how I changed Python’s source code and compiled from scratch to accept "else-less" if expressions, similar to Ruby's "inline if", also known as conditional modifier 👇 Why? The idea of having an else-less if expression in ...

Markdown supported · ⌘↵ to post
Juan Francisco Roco
Innovating since the 70s...
Congratulations... I read about this on PyCoder's Weekly
Isn't this enough for your use case (pure and simple Python)?
>>> 42 * True 42 >>> 21 * False 0 >>> a = 42 >>> a += 1 * False >>> a 42 >>> a += 1 * True >>> a 43