Variables and their domain
Terry Reedy
tjreedy at udel.edu
Thu Nov 29 18:36:39 EST 2007
"Jose Ignacio Gisbert" <jigisbert.etra-id at grupoetra.com> wrote in message
news:007b01c8327c$9fcffa40$2000a8c0 at depid.local...
| I have one doubt, in my applciation I have a method (Method1) which has
| other method (Method2) inside of it.
You have a function inside a function. In Python, methods are functions
bound to classes.
| Method1
| Lista=a,b,c,d.
That makes a tuple, not a list. Do
lista = [a,b,c,d]
to make a list that you can modify inside an inner function using item or
slice assignment or modify-in-place methods
| Lb=listbox
| Method2
| Lista=e,f,g.. -->error!
lista[:] = [e,f,g]
will replace the contents of lista
Good luck.
tjr
More information about the Python-list
mailing list