~/talk

Functional Programming in Python

Talkat PyData Berlin 2016 · 2016-05-20..05-21· [python]
links:none on file
slides:none on file

Claims that Python supports functional style enough to be useful, demonstrates partial function application, currying, closures, decorators and function composition, and shows concrete code: a CSV parser reimplemented as composed map/filter/partial steps and a K‑means pipeline that runs on PySpark. Uses tool libraries (funktools, fn.py, toolz) for currying and composition, notes missing niceties like nicer lambda syntax and builtin immutability, and the examples run and clarify tradeoffs.

AI-written summary · about

  1. 0:00Welcome Remarks
  2. 0:19About Me (Daniel Kirsch)
  3. 1:06About This Talk
  4. 1:20Disclaimer - PEP 20
  5. 3:19Vocabulary of Concepts
  6. 3:47Purity (Functions Without Side-Effects)
  7. 4:23First Class Functions
  8. 4:54Higher-Order Functions
  9. 5:32Decorators as Higher-Order Functions
  10. 5:49Partial Function Application
  11. 7:15Currying
  12. 9:05Interlude: Closures
  13. 9:55Currying Example from the Standard Library
  14. 10:53Functional Collection Transformations (Map, Filter, & Reduce)
  15. 11:04Map
  16. 11:39Filter
  17. 12:12Reduce
  18. 14:01Function Composition
  19. 15:16Example: A Bad CSV Parser (1/3)
  20. 15:38Example: Imperative Python (2/3)
  21. 16:18Example: Functional Python (3/3)
  22. 20:35Example: PySpark
  23. 21:26Example: K-Means
  24. 23:15Main Takeaways
  25. 23:53What is Missing in Python
  26. 25:00Functional Libraries
  27. 25:38Nicer Lambda Syntax
  28. 26:05Other Interesting Stuff
  29. 26:16Other Talks (Where I Have Stolen Material)
  30. 27:13More FP?
  31. 27:38Thank You
  32. 28:10Audience Questions: Do you have a workaround for Immutability?
  33. 29:58Audience Questions: Composition in Python is ugly, any workaround?
  34. 31:43Audience Comment: Cannot assume the Pure Function example won't have a side-effect.
  35. 32:43Audience Question: Underscore construct in PySpark
  36. 34:39Audience Question: Any Python packages that try to mimic Scala like functional programming?
  37. 35:34Audience Question: List Comprehensions are faster than map(), what is your take?
  38. 38:17Last Question: Have you looked at Hy dialect?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.