~/talk

Fun with Python's newer tools

Talkat EuroPython 2011 · 2011-06-20..06-26· [python]
slides:none on file

Demos show concrete tools and recipes: collections.Counter is a dict subclass that returns zero for missing keys, offers elements() and most_common(n), supports arithmetic including negative counts and a saturating subtraction variant, and the implementation is a few lines. namedtuple gives zero extra memory, a replace() method for prototype/defaults and easy subclassing with __slots__. A decorator lru_cache bounds caches (fibo(100) reduces calls to 101), and the new str.format supports attribute/index lookup and a thousands separator.

AI-written summary · about

  1. 0:00Introduction
  2. 2:37Collections Counter
  3. 8:01Results Counter
  4. 8:58Word Count
  5. 10:14Most Common
  6. 12:34Least Common
  7. 15:21Saturation Subtraction
  8. 17:04Name tuples
  9. 21:41Test results
  10. 25:43Convenience methods
  11. 29:52Pro tip 1
  12. 30:56Pro tip 2
  13. 34:36My opinion
  14. 36:33Cache
  15. 41:03Dynamic Programming
  16. 43:51FiboCover
  17. 46:16String Formatting
  18. 53:51Previous Slides
~/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.