Demystifying Python Decorators: A Beginner's Guide

preview_player
Показать описание
Find out how decorators are just syntactic sugar over higher order functions.

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

2:21 -- I think the best way to convince someone go to down the FP rabbit hole is to:

- show them some code (e.g. a for-loop constructing a list from another)
- tell them "don't you wish there was a more elegant way to achieve this?"
- then show them the map(fn, list) function
- finally explain how it works (don't explain it first, and show it later, leave the theory for last)

Otherwise, you start talking about syntax and theory with contrived examples that don't really show the elegance of those techniques.

In other words, if you want a criminal who to learn about chemistry, tell them "don't you wish there was a way to get rid of evidence without leaving traces?". That'll get their interest, and now they're primed to listen and learn. 😆

vlc-cosplayer
Автор

I think there is a bug in your example code, eg at 4:56, line 24, shouldn't the variable be mult_result?

poddmo
visit shbcf.ru