Skip to content
0:00 / 0:00

#pythonmodules#importsystem#finders

What happens when you import a module? - presented by Reuven M. Lerner

EuroPython Conference

36K subscribers • 31 videos on Hallway • Conference channel

YouTube
  • One of the most-watched uploads on EuroPython, a conference or university channel Hallway lists. Nobody has recommended it in the communities yet, so it ranks below community picks.
  • Presented by Reuven M. Lerner

Intermediate. Assumes working knowledge.

5.5K views4 years ago

Programming languagesPython

Reuven M. Lerner explains the internal mechanics of Python's import system, detailing how finders and loaders locate and load modules into memory.

EuroPython 2022 - What happens when you import a module? - presented by Reuven M. Lerner [The Auditorium on 2022-07-13] Modules are a key feature of Python, allowing us to easily reuse our own code and take advantage of publicly available modules from PyPI. It's a rare program that doesn't include at least one "import" statement. But what actually happens when we import a module? How does Python find our file? How does it decide whether it should even try to find our module? And after it finds our module file, how does Python load it into memory, assigning to its attributes? In this talk, I'll walk you through what happens when you "import" a module into Python. The mechanism is surprisingly complex, in no small part because it has to take so many possibilities into consideration. We'll talk about finders and loaders, and about the many ways in which you can customize the module-loading mechanism if you find a need to do so. If you've ever imported a module, then this talk will pull back the curtain a bit, helping you to understand what's happening under the hood. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License creativecommons.org/licenses/by-nc-sa/4.0/

Why it's here

A top upload from a listed channel

EuroPython is on Hallway's list of conference and university channels, and this upload is one of its most-watched talks or lectures. Nobody has recommended it in the communities yet, so it ranks below community picks.