~/talk

Import Deep Dive

Talkat EuroPython 2015 · 2015-07-20..07-26· [python, web-platform]
speakerdeck:encukou
slides:none on file

Explains exactly what import does: Python checks sys.modules cache, constructs a module spec describing loader and origin, creates an empty module object, inserts it into the cache, then executes code (or loads bytecode/C extensions/frozen modules). Covers surprising behaviors: import cycles yield half-initialized modules, zip and URL importers, and pyc cache semantics; contrasts built-in versus extension versus source modules and shows how import hooks and meta_path path_hooks decide which loader wins. Includes practical rules to avoid breakage.

AI-written summary · about

  1. 0:00Intro
  2. 0:59Import
  3. 2:59Import Algorithm
  4. 5:30Loading
  5. 13:51Modules
  6. 15:30Loading Modules
  7. 22:06Questions
  8. 24:16Time to Bits
~/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.