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

Star Unpacking For Own Classes

I was wondering if it's possible to use star unpacking with own classes rather than just builti… Read more Star Unpacking For Own Classes

Python: Is There Syntax-level Support For Unpacking, From Tuples, The Arguments To An *anonymous* Function?

Suppose we have the following: args = (4,7,5) def foo(a,b,c): return a*b%c Python conveniently all… Read more Python: Is There Syntax-level Support For Unpacking, From Tuples, The Arguments To An *anonymous* Function?

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?

Unpacking Iterables In Python3?

Why is this returning in sort_tup_from_list for key, val in tup: ValueError: not enough values to u… Read more Unpacking Iterables In Python3?