~/talk

Functional Python: Saving Christmas with itertools & friends

Talkat Swiss Python Summit 2025 · 2025-10-16..10-17· [python, functional-programming]
links:none on file
slides:none on file

Uses itertools.pairwise() to replace nested neighbor loops (computes adjacent differences), uses itertools.product() to enumerate 2^(k-1) operator combinations for the bridge-repair puzzle, and uses functools.reduce() plus operator.add to fold column-major bits into a binary string. Shows zip(*) transposition for 2021 Day 3, notes more-itertools for windowed/chunked helpers, and demonstrates that a mutable, imperative class is necessary for the disk-compaction puzzle where purely functional copies blow up memory and performance.

AI-written summary · about

  1. 0:00Introduction
  2. 1:10Why functional Python
  3. 3:17Brute force vs functional
  4. 4:42Functional principles
  5. 6:27Pure functions example
  6. 8:15Higher-order functions
  7. 9:18Iterators and generators
  8. 11:50Built-in functional tools
  9. 13:17Advent of Code patterns
  10. 15:26Neighbors with pairwise
  11. 16:30Combinations with product
  12. 18:22Operator module demo
  13. 20:26Combinatorics tools
  14. 20:49Aggregation and reduction
  15. 21:31Transposing with zip
  16. 24:26Reducing to single value
  17. 25:33When functional fails
  18. 27:19Mutable state example
  19. 28:45Right tool for the job
  20. 29:05Key takeaways
  21. 29:50Resources and closing
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.