forwarding *arg parameter

Tuomas tuomas.vesterinen at pp.inet.fi
Sun Nov 5 10:26:58 EST 2006


 >>> def g(*arg):
...     return arg
...
 >>> g('foo', 'bar')
('foo', 'bar')
 >>> # seems reasonable
...
 >>> g(g('foo', 'bar'))
(('foo', 'bar'),)
 >>> # not so good, what g should return to get rid of the outer tuple

TV



More information about the Python-list mailing list