~/talk

Simplifying Python Code through the Lens of Functional Programming

Talkat PyCon Italia 2024 · 2024-05-22..05-25· [python, functional-programming]
slides:none on file

Shows a concrete refactor: take a CSV of names/scores, compare a chatGPT baseline, an imperative split-into-three-functions refactor, and a functional pipeline built with currying, composition and a pipe helper. Uses Polars for comparison, then implements a pure-Python pipeline using a Box style Left/Right box (ponet) to carry success/failure, plus tests written with Hypothesis and a temporary file. Works on small files (10 rows) but exhibits quadratic slowdowns vs Polars’ linear performance at 1M rows. Emphasizes pure functions and composition.

AI-written summary · about

  1. 0:00Introduction to FP in Python
  2. 4:00Refactoring to functions
  3. 7:31Single responsibility principle
  4. 9:31Currying and composition
  5. 12:27Pipe operators and error handling
  6. 14:37Railway oriented programming
  7. 17:43Functional vs imperative
  8. 23:17Live demo and Q&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.