~/talk

Exploring Functional Options in Python

Talkat PyCon Italia 2025 · 2025-05-28..05-31· [python]
name:Rami Awar
links:none on file
slides:none on file

Starts with a simple get_text function for a document‑analysis client, adds many parameters, and then explores designs: raw expanded signature, a pydantic config class for separated validation, a direct port of Go’s functional options (static methods that return callables applied to a headers dict), and finally a builder/chain that stores options in an object. The claim is that functional options work but feel un‑Pythonic; builder/chain gives localized docs, reasonable validation, and a simpler API after about a week of iteration.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:49Problem and design goals
  3. 3:17Sam's initial simple solution
  4. 6:27Extending the function with more options
  5. 9:39Maintaining good code principles
  6. 10:43Improving with config classes
  7. 14:03Introducing functional options
  8. 18:59Method chaining and builder pattern
  9. 21:49Why Go prefers functional options
  10. 25:04Design evolution summary
  11. 27:36Key takeaways and resources
  12. 29:09Q&A session
~/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.