Perl's lack of 'in' keyword

James Laver james.laver at
Fri Oct 10 13:37:59 BST 2008

On 2008-10-10 13:21, "Paul Makepeace" <paulm at> wrote:

> Back to programming languages(!)
> Just as a different perspective, here is Python growing a ternary operator,
> i.e. how to get the same behavior as the C-like C ? A : B. There was
> considerable debate about this, with Guido eventually Making a Decision.
> What's interesting is that python gets ?: without any additional keywords,
> or... punctuation:
> There's no moral judgment here, just thought it was an interesting aside
> from lies & nazism.
> P

Much cleaner than the old and-or trick.

for the non-pythoners:

(condition and [iftrue] or [iffalse])[0]

Explanation (quickly googled) here:

Did you catch Guido's reasoning for not adding true lambdas a while back?
They're about the only thing the python community really wanted out of
python3k and there are some very disappointed python lovers out there...


More information about the mailing list