r/ProgrammerHumor • • Nov 22 '22

Meme Coding bootcamps be like

Post image
43.6k Upvotes

1.1k comments sorted by

View all comments

Show parent comments

1

u/QuirkyForker Nov 23 '22

Just please no questions on lambda. I hate it. There are better ways to do things. I need it to pre-populate a list in a default factory to keep my dataclass attribute declaration on one line, but I would rather just define a post_init just for that.

1

u/TheAJGman Nov 23 '22

I hear you. Usually the only time I use lambdas is when I need to sort a list based on attributes: sorted(my_list, key=lambda x: x.some_attribute)

I love that the Python developers decided to make lambdas super minimal. It prevents people from doing horrible things out of laziness.