On Thu, Dec 15, 2011 at 1:41 PM, Alexander Heger
Dear Oleg,
OK, these work for the examples I listed, I had not tried that. Thanks!
I still think the element extraction would be nice, though. what does not work your way is x = [1,2,3] y = (0,) + x
The following works --> x = [1,2,3] --> y = (0,) + tuple(x) --> y (0, 1, 2, 3)
Explicit (i.e. tuple conversion) is better than implicit (The Zen of Python) André
but y = (0,*x) could do ... ?
-Alexander
On 12/15/2011 11:33 AM, Oleg Broytman wrote:
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.
______________________________**_________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/**mailman/listinfo/python-ideashttp://mail.python.org/mailman/listinfo/python-ideas