tuple to list to tuple conversion

Vinoo vasudevan ee01b092 at ee.iitm.ernet.in
Tue Jun 3 05:25:29 EDT 2003


Can someone tell me what I'm doing wrong here?

I have a method that needs to call other methods like this:
def mymethod(self, methodname, params):
    apply(methodname, params)

params is already a tuple. I needed to add a few more parameters inside 'mymethod' so I 
did this:
params = tuple((list(params)).append(something))
when params is an empty tuple to begin with, the stmt sets it to None instead of 
(something, )
However the following works regardless of whether params is empty:
x = list(params)
x.append(something)
params = tuple(x)

Thanks in advance,

Vinoo

--
Open WebMail (http://www.ee.iitm.ernet.in)






More information about the Python-list mailing list