Given that I have single element iterable such as tuple
t = (1,)
Is there a preferred way of unpacking that tuple into a variable? There are many options, which have different pros and cons.
unpacked, = t # Elegant but easy to overlook.
(unpacked,) = t # Maybe a bit clunky?
unpacked, *_ = t # Creates the impression, that there might be more elements.
unpacked = t[0] # Same as above.
*_, unpacked = t # Same as above, but also gives the impression
# that we are accessing the last element.
[unpacked] = t # Elegant and obvious.
Does PEP8 have any recommendation on this?