3 ms·
python variables are stored in locals()(read only dict) we have "{NAME : EXPR}" for dict just do "(NAME : EXPR)" with parenthesis within its scope, list comp
by guramarx 8y ago
python variables are stored in locals()(read only dict)
we have "{NAME : EXPR}" for dict
just do "(NAME : EXPR)" with parenthesis
within its scope, list comp can be
<code>results = [b for a in data if (b: f(a))]</code>
perhaps even with c++ range based for the win
<code>results = [win for (the: data) if (win: f(the))]</code>