Python Knowledge Share: Modules, namespaces and imports

Опубликовано: 28 Июль 2026
на канале: Michael Foord
354
8

A one hour Python Knowledge Share on the topic of Modules, namespaces and imports. Delivered to Gigaclear devs on 16th May, 2024.

Topics covered include:

Import syntax variations
namespaces and variable lookups
sys.modules and the import cache
Module objects
Module level functionality: _dir_ and _getattr_
Packages and the filesystem
Relative import syntax
Module reloading (how to do it and why not to do it)
Circular imports, avoiding and fixing
Executable modules and packages
importlib and _import_

Slides and source code available at: https://github.com/voidspace/talks