Python Frequently Asked Questions, Release 3.9.5 meta path finder A finder returned by a search of$_{sys.meta_path}$ . Meta path finders are related to, but different from path entry finders . metaclass The class of a class. Class definitions create a class name, a class dictionary, and a list of base classes. The metaclass is responsible for taking those three arguments and creating the class. Most object oriented programming languages provide a default implementation. What makes Python special is that it is possible to create custom metaclasses. Most users never need this tool, but when the need arises, metaclasses can provide powerful, elegant solutions. They have been used for logging attribute access, adding thread-safety, tracking object creation, implementing singletons, and many other tasks. method A function which is defined inside a class body. If called as an attribute of an instance of that class, the method will get the instance object as its first argument (which is usually called$_{self}$). See function and nested scope . method resolution order Method Resolution Order is the order in which base classes are searched for a member during lookup. See The Python 2.3 Method Resolution Order for details of the algorithm used by the Python interpreter since the 2.3 release. module An object that serves as an organizational unit of Python code. Modules have a namespace containing arbitrary Python objects. Modules are loaded into Python by the process of importing . module spec A namespace containing the import-related information used to load a module. An instance of importlib.machinery.ModuleSpec . MRO See method resolution order . mutable Mutable objects can change their value but keep their$_{id()}$ . See also immutable . named tuple The term “named tuple” applies to any type or class that inherits from tuple and whose indexable elements are also accessible using named attributes. The type or class may have other features as well. namespace The place where a variable is stored. Namespaces are implemented as dictionaries. There are the local, global and built-in namespaces as well as nested namespaces in objects (in methods). Namespaces support modularity by preventing naming conflicts. For instance, the functions$_{builtins.open}$ and$_{os.open()}$ are distinguished by their namespaces. Namespaces also aid readability and maintainability by making it clear which module implements a function. For instance, writing$_{random.seed()}$ or$_{itertools.islice()}$ makes it clear that those functions are implemented by the$_{random}$and$_{itertools}$modules, respectively. namespace package A PEP 420 package which serves only as a container for subpackages. Namespace packages may have no physical representation, and specifically are not like a regular package because they have no __init__.py file. nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to variables in the outer function. Note that nested scopes by default work only for See also module . Several built-in types are named tuples, including the values returned by$_{time.localtime()}$ and$_{os.}$ stat() . Another example is$_{sys.float_info}$ : See also package . More information can be found in metaclasses. See$_{importlib.abc.MetaPathFinder}$ for the methods that meta path finders implement. >>> sys.float_info[ 1] # indexed access 1024 >>> sys.float_info .max_exp # named field access 1024 >>> isinstance(sys.float_info, tuple) # kind of tuple True Appendix A. Glossary 84 Some named tuples are built-in types (such as the above examples). Alternatively, a named tuple can be created from a regular class definition that inherits from$_{tuple}$and that defines named fields. Such a class can be written by hand or it can be created with the factory function$_{collections.namedtuple()}$ . The latter technique also adds some extra methods that may not be found in hand-written or built-in named tuples.