~/talk

Python Tips, Tricks, and Idioms

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

A fast tour of concrete Python tips: use \N{...} for readable Unicode literals, copy lists with [:], and read files in fixed chunks with iter(f.read, '') instead of while loops; sort by multiple keys using stable sort via two-pass (secondary key first), and replace list insert(0)/pop(0) with deque for O(1) pop(0) to fix scalability. Covers enumerate/zip for lock‑step iteration, else on for-loops as “not found” after break, key functions and itemgetter, iterators/generators, defaultdict/Counter/OrderedDict, and a dict‑sparsify trick for internal resizing.

AI-written summary · about

  1. 0:00Start
  2. 5:31Negative Slicing
  3. 10:52Basics
  4. 14:15Lockstep Iteration
  5. 17:56Reason Not To Use an Else in the Absence of a Break
  6. 19:01Complex Numbers
  7. 43:20Dictionary Is Missing Method
~/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.