Re: [Python-ideas] A real life example of "given"

A side comment:
Probably, I would write @make_dict def potential_updates(): for x in need_initialization_nodes: for y in [x, *x.synthetic_inputs()]: potential_update = command.create_potential_update(y) if potential_update is not None: yield y, potential_update If such pattern covered a lot of examples, even some syntax sugar could be added. For example: foo[0].potential_updates = dict(_) from: for x in need_initialization_nodes: for y in [x, *x.synthetic_inputs()]: potential_update = command.create_potential_update(y) if potential_update is not None: yield y, potential_update where <statement> from: <suite> would be equivalent to def _(): <suite> _ = _() <statement> Best regards, Adam Bartoš
participants (1)
-
Adam Bartoš