~/talk

Pythonic iterators and generators

Talkat PyCon Australia 2013 · 2013-07-05..07-07· [python]
links:none on file
slides:none on file

Shows exact code patterns and library calls: use zip then dict for pairing, use itertools.chain and chain.from_iterable (added in Python 2.6) to flatten streams, use itertools.product and itertools.combinations to build Cartesian products and power sets, implement custom iterators with __iter__ and next and write yield-based generators for lazy sequences. Demonstrates a Fibonacci iterator, a deck-of-cards iterable, using itertools.count for infinite streams, and using generators plus itertools.islice to process huge CSVs without loading everything.

AI-written summary · about

  1. 0:00Introduction
  2. 0:51Warm-up exercises
  3. 5:47Advanced itertools examples
  4. 7:32Understanding iterators
  5. 11:27Built-in iterators and uses
  6. 17:25Creating custom iterators
  7. 18:36Introduction to generators
  8. 22:31Generators in practice
  9. 25:43Conclusion and summary
  10. 27:31Q&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.