no tupelunpacking

Thomas Thiele thiele at muc.das-werk.de
Fri May 19 07:29:40 EDT 2000


What is the best way to do this:

def f1( a, b ):
	...do something with a und b...


def f2(...):
	...calculate ret_a, ret_b
	return ret_a, ret_b

...

a, b = f2(...)
f1(a ,b) 

is o.k. (tupelunpacking, I know)

but I want to write:

f1(f2(...))


The problem happens if you have such a constructor __init__(self, *argv)
(Inside __init__ argv is a tupel), and you want to call this constructor
from a derived class.

class A:
	def __init__(self, *argv):
		...

class B(A):
	def __init__(self, *argv):	
		A.__init__(self, argv) #doesn't work!!!!



More information about the Python-list mailing list