[Python-Dev] The `for y in [x]` idiom in comprehensions

Ethan Furman ethan at stoneleaf.us
Thu Feb 22 15:03:34 EST 2018


On 02/22/2018 11:54 AM, Joao S. O. Bueno wrote:
 > On 22 February 2018 at 16:04, Serhiy Storchaka wrote:

 >> Stephan Houben proposed an idiom which looks similar to new hypothetic
 >> syntax:
 >>
 >>      result = [y + g(y) for x in range(10) for y in [f(x)]]
 >
 > This thing has bitten me in the past -

Do you recall how?  That would be useful information.

--
~Ethan~


More information about the Python-Dev mailing list