The Functools Module

preview_player
Показать описание
Are you ready to power up your Python skills? The Python programming language has more than 200 modules in its standard library. In this tutorial, you will learn about functools, a module that is tailor-made for acting on or returning other modules.

You will learn about how to use functool decorators effectively, caching, function overloading and more!

Speaker: Mike Driscoll

Mike has been a Python developer for over a decade. He has been writing about Python for many years on his blog, The Mouse vs the Python. He has recently restarted his Python Youtube channel too. His readers got him interested in writing books about Python and now Mike has ten books published!
Рекомендации по теме
Комментарии
Автор

0:00 Video starts
0:12 Webinar began
1:30 Speaker began his presentation

2:28 The `functools` module
3:43 Caching
4:14 `functools.cache`
5:00 Code example 1
6:25 Code example 2
8:07 `functools.lru_cache`
8:12 Code example
11:41 `functools.total_ordering`
12:45 Code example
15:28 `functools.partial`
15:50 Code example 1
17:05 Code example 2 (featuring tkinter)
19:17 Code example 3 (featuring wxPython)
22:06 `functools.reduce`
24:23 Code example
26:08 `functools.singledispatch`
27:37 Code example
33:12 Honourable mentions of `plum` and `multipledispatch`
34:50 `functools.wraps`
35:07 Code example
39:00 Wrapping up

39:45 Q&A Session
39:58 Question 1: Compatibility with PyPy?
41:09 Question 2: Using `cache` and `lru_cache` in async functions?
42:40 Question 3: Any issue with `lru_cache`'s `maxsize`?
43:35 Clarification on Question 1: Speed difference between PyPy vs CPython with functools caching?
44:28 Question 4: Organise dispatched functions into a class?
47:00 Conclusion

Please feel free to point out any mistakes.
Thanks for the webinar.

NicolasChanCSY
Автор

Great tutorial! Explains some fairly complex topics very clearly and with easy-to-understand examples. Thank you, Mike :)

TheMako
Автор

`functools.cache_property` was mentioned in table of contents but not discussed further? Or did I missed it?

NicolasChanCSY
Автор

This is the least immersive, round about, poor quality, slow paced wreck to ever offer itself as a python tutorial. Awful.

TheGroundskeeper