~/talk

Python 103: Mmmm... Understanding Python's Memory Model, Mutability, and Methods

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

Explains why Python passes object references and how mutability changes observable behavior, demonstrates CPython’s reference counting plus a cycle detector and the undocumented small-int interning up to 256, shows pitfalls with aliasing vs shallow copies and how copy.deepcopy fixes them. Builds a Time60 class with __str__ and __add__ that normalizes minutes to hours (works in examples). Gives performance tips using timeit, caching repeated len()/func calls, describes list growth (amortized doubling then tapering) and recommends collections.deque for fast pops/pushes at both ends.

AI-written summary · about

  1. 0:00Start
  2. 1:58How I Got Started
  3. 23:23Special Methods
  4. 1:11:59Memory Allocation
  5. 1:14:58Shrinking
  6. 1:15:50Double Ended Queue
~/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.