Everything is a Python module
summary
Explains how Python's import system can be customized so non-Python files act like modules — for example importing a JSON file with import config or exposing JPG metadata via import gps_coordinates from album.IMG00001. Shows using Python magic methods and some monkey-patching to extend the import machinery for these use cases.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:30Import time in Python
- 5:19Quantum language as module
- 6:25Python import machinery
- 12:24Extending import with private APIs
- 13:48Hacking import system
- 17:22Live demo: ABM module
- 20:15Testing and use cases
related talks
45mWhat happens when you import a module?
21mUnderstanding the Magic of Python Modules and Packages
26mWhat happens behind execution of an `import` statement?
21mHacking the Python Import System
28mImport Deep Dive
30mImporting Without "import": Behind the Scenes of importlib
26mModules 101: how to avoid spaghetti, big balls of mud and houses of straw!
32mfrom hat import rabbit: Hacking your way through Python's import machinery for fun and profit
