Article 5PMX5 LXer: How I patched Python to include this great Ruby feature

LXer: How I patched Python to include this great Ruby feature

by
LXer
from LinuxQuestions.org on (#5PMX5)
Published at LXer:

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

Read More...latest?d=yIl2AUoC8zA latest?i=4OpxbwKyeXc:5il7BAA22tU:F7zBnMy latest?i=4OpxbwKyeXc:5il7BAA22tU:V_sGLiP latest?d=qj6IDK7rITs latest?i=4OpxbwKyeXc:5il7BAA22tU:gIN9vFw4OpxbwKyeXc
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments