May 2019
Beginner
528 pages
29h 51m
English
In the “Functions” chapter, we showed that each identifier has a scope that determines where you can use it in your program, and we introduced the local and global scopes. Here we continue our discussion of scopes with an introduction to namespaces.
Scopes are determined by namespaces, which associate identifiers with objects and are implemented “under the hood” as dictionaries. All namespaces are independent of one another. So, the same identifier may appear in multiple namespaces. There are three primary namespaces—local, global and built-in.
Each function and method has a local namespace that associates local identifiers (such as, parameters and local variables) with objects. The local namespace ...
Read now
Unlock full access