Tuple unpacking: dummy variable vs index

Posted by peter on Stack Overflow See other posts from Stack Overflow or by peter
Published on 2010-04-06T05:24:56Z Indexed on 2010/04/06 5:33 UTC
Read the original article Hit count: 304

Filed under:
|
|

What is the usual/clearest way to write this in Python?

value, _ = func_returning_a_tuple()

or:

value = func_returning_a_tuple()[0]

© Stack Overflow or respective owner

Related posts about python

Related posts about pythonic