Coder Bits and Pieces
Thursday, May 8, 2008
Definitional tuple-packing in Python
Python functions may tuple-pack their arguments.
def foo(a, (b, c)):
print a, b, c
>>> foo(10, (20, 30))
10 20 30
Arguments unpack during evaluation.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment