July 2021
Intermediate to advanced
392 pages
9h 40m
English
In this chapter, we'll cover Python modules. Modules are files containing functions and class definitions. The concept of a namespace and the scope of variables across functions and modules are also explained in this chapter.
The following topics will be covered in this chapter:
Names of Python objects, such as the names of variables, classes, functions, and modules, are collected in namespaces. Modules and classes have their own named namespaces with the same name as these objects. These namespaces are created when a module is imported or a class is instantiated. The lifetime of a namespace of a module is as long as the current Python session. The ...