[Python-ideas] list / array comprehensions extension

Oleg Broytman phd at phdru.name
Thu Dec 15 18:33:11 CET 2011


On Thu, Dec 15, 2011 at 10:26:50AM -0600, Alexander Heger wrote:
> x = [1,2,3]
> y = [0,*x]
> to obtain [0,1,2,3]

y = [0] + x

> or similar for lists
> x = (1,2,3)
> y = (0,*x)
> to obtain (0,1,2,3)

y = (0,) + x

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.



More information about the Python-ideas mailing list