list[] = var => list.append(var) (phpstyle)

Emile van Sebille emile at fenx.com
Sun Jul 15 01:40:28 CEST 2001


Alex is right as long as var_to_append is already a list.  For non-lists
though you can also do

list_var += 1,

or,

list_var += (1,)


--

Emile van Sebille
emile at fenx.com

---------
"Nick Perkins" <nperkins7 at home.com> wrote in message
news:LF447.476898$eK2.98947068 at news4.rdc1.on.home.com...
>
> "Alex Martelli" <aleaxit at yahoo.com> wrote in message
> ...
> >     list_var += var_to_append
> ...
>
> you mean:
>
> list_var += [var_to_append]
>
> or,
>
> list_var += list_to_extend
>
>
>




More information about the Python-list mailing list