Skip to content Skip to sidebar Skip to footer
Showing posts with the label Iterable Unpacking

How To Define A Tuple Of Randint Without Repeating Code?

I often get to use tuples of randint for color-values and such like (a, b, c) = randint(0, 255), ra… Read more How To Define A Tuple Of Randint Without Repeating Code?

Is It Possible To Assign A Default Value When Unpacking?

I have the following: >>> myString = 'has spaces' >>> first, second = myS… Read more Is It Possible To Assign A Default Value When Unpacking?

Unpacking Generalizations

PEP 448 -- Additional Unpacking Generalizations allowed: >>> LOL = [[1, 2], ['three… Read more Unpacking Generalizations

Python Futures And Tuple Unpacking

What is an elagant/idiomatic way to achieve something like tuple unpacking with futures? I have cod… Read more Python Futures And Tuple Unpacking