How I Changed Python to Accept "else-less" If Expressionsby@miguendes

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

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

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.

People Mentioned

Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - How I Changed Python to Accept "else-less" If Expressions
Miguel Brito HackerNoon profile picture

@miguendes

Miguel Brito


Receive Stories from @miguendes

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa