~/talk

Writing Functional Code in Python

Talkat PyCon US 2022 · 2022-04-27..05-03· [python]
name:Vic Kumar
links:none on file
slides:none on file

Claims that Python can be written in a functional style and shows concrete tools and results: uses recursion and itertools.reduce to remove mutation, publishes a small library you can pip install pi-effects, demonstrates Option and Try wrappers to make emptiness and exceptions explicit, and runs parallel tasks with futures to combine results. Example combines two threads (3s and 5s) to produce 150 in about 5s, shows an error case where one future fails, and uses future.traverse to invert lists of futures into a future of list.

AI-written summary · about

  1. 0:00Introduction
  2. 1:33What is functional programming
  3. 4:18Pure functions and referential transparency
  4. 7:06Eliminating mutable state with recursion
  5. 8:54Higher-order functions and reduce
  6. 9:37Handling emptiness with Option
  7. 14:07Managing exceptions with Try
  8. 19:24Concurrency with Futures
  9. 23:38Combining Futures efficiently
  10. 25:22Key takeaways from functional programming
  11. 26:25Q&A
~/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.