Unrolling of actual parameters from list
Roberto Cavada
cavada at irst.itc.it
Fri Jan 24 08:13:36 EST 2003
Hi there,
consider this class definition:
class Foo:
def __init__(self, a, b):
# do something
return
pass # end of class
Suppose now you want to create a Foo instance by passing a *list* of
actual parameters:
l = [10,20]
foo = Foo(l) # this - as you can guess - does not work
Is there a way to do that?
Thanks,
rob
--
------------------------------------------------------
Roberto Cavada
ITC-irst Institute for Scientific and Technological Research
Automated Reasoning Systems - Formal Methods Group
Via Sommarive, 18 - 38050 Povo (TN) - Italy
Tel: +39 0461 314 321 Fax: +39 0461 302 040
cavada at irst.itc.it http://sra.itc.it/people/cavada/
------------------------------------------------------
More information about the Python-list
mailing list