Python Standard Library: Functools

preview_player
Показать описание
This video covers the parts you should know from the functools module. This is a longer video, so here are some timestamps for the main sections.

00:31 - Caching
12:04 - Partials and Reduce
20:18 - Wrappers
25:48 - Dispatches and Ordering

Рекомендации по теме
Комментарии
Автор

What do you use most from functools? For me, it has to be caching, followed by partials.

JakeCallahan
Автор

Had a use for reduce recently at work. My tester wanted to combine some nested dictionaries, so I wrote a function for him to do it, which took two dictionaries and returned a new dictionary that was the combination of the two.

Two days later he said "can we do this with a list of dictionaries" and reduce was the perfect way to do that.

I probably wouldn't use this for production code, but for test suite code it ended up being a great solution

Deemo_codes
Автор

Man i discovered your channel a week back and i am so glad... Great job with these videos🫡

halfbakedthoughts
Автор

20:00 💡 moment you have created factorial using partial reduce ..that's interesting .

dipankarbose