static arrays becoming value types

bearophile bearophileHUGS at lycos.com
Wed Oct 21 11:54:34 PDT 2009


Leandro Lucarella:

> In python you can even do:
> 
> def f(a, b, c):
> 	print a, b, c
> 
> x = (b, c)
> f(a, *x) # calls to f(a, b, c)

In Python2.x you can also do:

def foo(x, (y, (z1, z2))):
    print z2
    print z1
    print y
    print x

Z = (1, 2)
yz = [0, Z]
foo(-1, yz)

That outputs:

2
1
0
-1

Bye,
bearophile



More information about the Digitalmars-d mailing list