paint-brush
How I Changed Python to Accept "else-less" If Expressionsby@miguendes
203 reads

How I Changed Python to Accept "else-less" If Expressions

by Miguel BritoAugust 27th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

"else-less" if expressions are similar to Ruby's "inline if", also known as a conditional modifier. Python 3.11.0a0 (heads/main:938e84b4fa, Aug. 6 2021, 08:59:36) [GCC 7.5.0] on linux. The 'else' is currently named 'F' in the language's grammar. The 'if' expression is an expression that returns nil if the expression evaluates to false. In Python, one cannot do that without explicitly adding an else to the expression.
featured image - How I Changed Python to Accept "else-less" If Expressions
Miguel Brito HackerNoon profile picture
Miguel Brito

Miguel Brito

@miguendes

L O A D I N G
. . . comments & more!

About Author

Miguel Brito HackerNoon profile picture
Miguel Brito@miguendes

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Cyberfishnews
Cyberfishnews