~/talk

"A Python Sequence (Un)Packing Primer"

Talkat PyOhio 2024 · 2024-07-27..07-28· [python]
links:none on file
slides:none on file

Explains that what looks like “multiple return” is actually tuple creation and unpacking, with the subtle rule that the comma makes the tuple and that nested unpacking and the star operator both capture and repack subsequences for assignments and function calls ( and map positional and keyword args). Demonstrates args/kwargs collection, class init forwarding, and the surprising gotcha that a generator is one-use and gets exhausted; confirms behavior by inspecting bytecode with the dis module bytecode disassembler.

AI-written summary · about

  1. 0:00Python sequence unpacking
  2. 2:07Multiple returns in Python
  3. 4:38Why unpacking matters
  4. 7:30Nested unpacking
  5. 10:42Star operator for subsequences
  6. 12:49Unpacking in function calls
  7. 14:58Collecting *args and **kwargs
  8. 17:05Unpacking in inheritance
  9. 19:58Mental models in Python
  10. 21:21Debugging unpacking
  11. 27:01Summary
~/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.