Reply to post: Re: Reinventing a more limited wheel

Python creator Guido van Rossum sys.exit()s as language overlord

Phil Endecott Silver badge

Re: Reinventing a more limited wheel

> results = [(x, y, x/y) for x in input_data if (y := f(x)) > 0]

That would surely be much more understandable in multiple lines:

vector<T> results;

for (x: input_data) {

auto y = f(x);

if (y > 0) results.append( make_tuple(x,y,x/y) );


...if that’s what it actually does....

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019