How Import Does Its Thing (#2)
Mr. Brett Cannon
30min Intermediate
categories:
core, py3k
Any piece of complex Python code must eventually reach outside of itself and import some external code. But how does Python do it? What are the steps an import follows in order to turn some external file into a module object for you to use? And is there a way to customize how the thing works?
This talk will pull back the covers and show how going from ``import this`` leads to a module object being created and inserted into your module's namespace. The focus will be on the algorithm that handles importation, not low-level details like how Python source is compiled into bytecode during importation. All discussions will focus around the planned semantics for imports in Python 3.0 (i.e., PEPs 302, 328, and 3100).
This talk will pull back the covers and show how going from ``import this`` leads to a module object being created and inserted into your module's namespace. The focus will be on the algorithm that handles importation, not low-level details like how Python source is compiled into bytecode during importation. All discussions will focus around the planned semantics for imports in Python 3.0 (i.e., PEPs 302, 328, and 3100).
Files:
| file | size | uploaded | comment |
|---|---|---|---|
| import_-_PyCon_2008.pdf | 833.0 KB | Tue, March 11th, 2:02 p.m. | PDF of slides |
# Permalink
.