Functional Programming (Theory of Python) (Python Tutorial)

preview_player
Показать описание
Let's take a look at functional programming, and some tools that Python provides. This includes the lambda expression, map, filter, zip, partial and reduce.

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

Much thanks for a video that returns clarity in pure way independent of global state :)

fabianhaglund
Автор

Thank you for this tutorial. It's really helpful

harshit.jindal
Автор

So reduce is the python equivalent to fold in haskell? As in foldr and foldl?

Alkis
Автор

While it makes the code look more elegant, it doesn't remove the obvious, procedural nature of python. By writing code like this you are making sure that a smaller number of people actually understand it, because for loops are more ubiquitous. Granted, it would take more lines of code but the flow would be easier to understand (even with yields) and also easier to debug.

That being said, we should be enforcing pure functions wherever possible. Sometimes it's a bit less practical and can make for long argument lists particularly in web frameworks, but the reward is that things become very easy to unit test. So, what you've paid in longer argument lists, you're getting a return in unit tests.

someoneelse
Автор

Tail recursion doesn't work in python right? Ran into a problem with large stacks recently.

SammeGalanakis
Автор

question: an iterator is an object that inherently has state! (same as a function that has a yield statement). So why is an iterator considered part of functional programming, which so frowns upon states??

chriswysocki
Автор

I enjoy functional programming but it feels like it's an after thought in Python

damonpalovaara
Автор

I want to know the person who has no existing knowledge on functional programming to watch this video and immediately starts converting his classes into functions. Seriously, have some overarching examples. You literally only just explained the Python docs in writing throughout the video.

stxnw