Daniel Kirsch - Functional Programming in Python
PyData Berlin 2016
There should be one-- and preferably only one --obvious way to do it. And that is functional - at least in my opinion. I'm working with Python for a living since two years after coming from a background in Ruby, Haskell, Clojure, and some more languages. Since then I have tried to marry ideomatic Python to the functional style I learned to love. It's time to share my experience.
I will talk about
- higher order functions
- partial function application and currying
- function composition
- functional collection transformations (and why they are relevant for PySpark)
- (fake) lazy evaluation
and how it all relates to Python (and what's missing).
Slides: https://github.com/kirel/functional-python
00:00 Welcome Remarks
00:19 About Me (Daniel Kirsch)
01:06 About This Talk
01:20 Disclaimer - PEP 20
03:19 Vocabulary of Concepts
03:47 Purity (Functions Without Side-Effects)
04:23 First Class Functions
04:54 Higher-Order Functions
05:32 Decorators as Higher-Order Functions
05:49 Partial Function Application
07:15 Currying
09:05 Interlude: Closures
09:55 Currying Example from the Standard Library
10:53 Functional Collection Transformations (Map, Filter, & Reduce)
11:04 Map
11:39 Filter
12:12 Reduce
14:01 Function Composition
15:16 Example: A Bad CSV Parser (1/3)
15:38 Example: Imperative Python (2/3)
16:18 Example: Functional Python (3/3)
20:35 Example: PySpark
21:26 Example: K-Means
23:15 Main Takeaways
23:53 What is Missing in Python
25:00 Functional Libraries
25:38 Nicer Lambda Syntax
26:05 Other Interesting Stuff
26:16 Other Talks (Where I Have Stolen Material)
27:13 More FP?
27:38 Thank You
28:10 Audience Questions: Do you have a workaround for Immutability?
29:58 Audience Questions: Composition in Python is ugly, any workaround?
31:43 Audience Comment: Cannot assume the Pure Function example won't have a side-effect.
32:43 Audience Question: Underscore construct in PySpark
34:39 Audience Question: Any Python packages that try to mimic Scala like functional programming?
35:34 Audience Question: List Comprehensions are faster than map(), what is your take?
38:17 Last Question: Have you looked at Hy dialect?
S/o to https://github.com/hfzvc for the video timestamps!
Want to help add timestamps to our YouTube videos to help with discoverability? Find out more here: https://github.com/numfocus/YouTubeVideoTimestamps
Видео Daniel Kirsch - Functional Programming in Python канала PyData
There should be one-- and preferably only one --obvious way to do it. And that is functional - at least in my opinion. I'm working with Python for a living since two years after coming from a background in Ruby, Haskell, Clojure, and some more languages. Since then I have tried to marry ideomatic Python to the functional style I learned to love. It's time to share my experience.
I will talk about
- higher order functions
- partial function application and currying
- function composition
- functional collection transformations (and why they are relevant for PySpark)
- (fake) lazy evaluation
and how it all relates to Python (and what's missing).
Slides: https://github.com/kirel/functional-python
00:00 Welcome Remarks
00:19 About Me (Daniel Kirsch)
01:06 About This Talk
01:20 Disclaimer - PEP 20
03:19 Vocabulary of Concepts
03:47 Purity (Functions Without Side-Effects)
04:23 First Class Functions
04:54 Higher-Order Functions
05:32 Decorators as Higher-Order Functions
05:49 Partial Function Application
07:15 Currying
09:05 Interlude: Closures
09:55 Currying Example from the Standard Library
10:53 Functional Collection Transformations (Map, Filter, & Reduce)
11:04 Map
11:39 Filter
12:12 Reduce
14:01 Function Composition
15:16 Example: A Bad CSV Parser (1/3)
15:38 Example: Imperative Python (2/3)
16:18 Example: Functional Python (3/3)
20:35 Example: PySpark
21:26 Example: K-Means
23:15 Main Takeaways
23:53 What is Missing in Python
25:00 Functional Libraries
25:38 Nicer Lambda Syntax
26:05 Other Interesting Stuff
26:16 Other Talks (Where I Have Stolen Material)
27:13 More FP?
27:38 Thank You
28:10 Audience Questions: Do you have a workaround for Immutability?
29:58 Audience Questions: Composition in Python is ugly, any workaround?
31:43 Audience Comment: Cannot assume the Pure Function example won't have a side-effect.
32:43 Audience Question: Underscore construct in PySpark
34:39 Audience Question: Any Python packages that try to mimic Scala like functional programming?
35:34 Audience Question: List Comprehensions are faster than map(), what is your take?
38:17 Last Question: Have you looked at Hy dialect?
S/o to https://github.com/hfzvc for the video timestamps!
Want to help add timestamps to our YouTube videos to help with discoverability? Find out more here: https://github.com/numfocus/YouTubeVideoTimestamps
Видео Daniel Kirsch - Functional Programming in Python канала PyData
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Joel Grus: Learning Data Science Using Functional PythonFunctional Design Patterns - Scott WlaschinEvery Clojure Talk Ever - Alex Engelberg and Derek SlagerFunctional Programming in 40 Minutes • Russ Olsen • GOTO 2018FP vs OOP | For DummiesCohesion and coupling: write BETTER PYTHON CODE Part 1Why Isn't Functional Programming the Norm? – Richard FeldmanTop to down, left to right (Surprise talk) - James PowellFunctional Programming for PythonistasFunctional Programming in Python: Lessons from Haskell and Clojure - Anthony KhongMonads, in my Python? by Xuanyi Chew50 Python Tips and Tricks for BeginnersRobert C Martin - Functional Programming; What? Why? When?What is functional programming | Easy wayFunctional Programming with PythonLearning Functional Programming with JavaScript - Anjana Vakil - JSUnconf“Hello, world” from scratch on a 6502 — Part 1Functional Programming in Python: Parallel Processing with "concurrent.futures""Outperforming Imperative with Pure Functional Languages" by Richard Feldman