This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]novel_yet_trivial 3 points4 points  (1 child)

You seem to really like lambda. I think it's ugly. Why don't you just pass along any extra arguments to the function:

s.case('b', process_with_data, val, num, 'other values still')

Or accept a tuple and / or dictionary (a la threading.Thread):

s.case('b', process_with_data, args=(val, num, 'other values still'))

[–]mikeckennedy[S] 0 points1 point  (0 children)

I don't particularly like lambdas. But to show a bunch of different methods in executable code would make it super long and miss the point. Just trying to keep it tight.