How I patched Python to include this great Ruby feature

Posted by bob on Sep 17, 2021 1:11 AM EST
Mail this story
Print this story

Ruby, unlike Python, makes lots of things implicit, and there's a special kind of if expression that demonstrates this well. It's often referred to as an "inline-if" or "conditional modifier", and this special syntax is able to return one value when a condition is true, but another value (nil, specifically) when a condition is false. Here's an example: read more

Full Story

» Read more about: Groups: Python, Ruby; Story Type: News Story

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.