News for hackers. Stuff that matters.
Re:PEP 572: Python assignment expressions has been accepted by eesmith on Tuesday July 03, 2018 @02:56PM (#17452781)
The best I could come up with involved some repetition, because of the double-comprehension boilerplate

  found_nodes = (node.find(SOME_XPATH) for node in tree)
  [found_node.get("value") for found_node in found_nodes
       if found_node is not None]
or as a one-liner:

  [found_node.get("value") for found_node in (
      node.find(SOME_XPATH) for node in tree) if found_node is not None]
It's 15 characters longer than your := version, at 110 characters instead of 95.

There are no comments on this comment yet.