In the August 2012 issue of ;login:, I explored some of the inner workings of Python’s import statement. Much of that article explored the mechanism that’s used to set up the module search path found in sys.path as well as the structure of a typical Python installation. At the end of that article, I promised that there is even more going on with import than meets the eye. So, without further delay, that’s the topic of this month’s article.
Just as a note, this article assumes the use of Python 2.7. Also, because of the advanced nature of the material, I encourage you to follow along with the interactive examples as they nicely illustrate the mechanics of it all.
© 2001-2024 Fundación Dialnet · Todos los derechos reservados