The Python Language Reference, Release 3.9.5 21 3.2. The standard type hierarchy Attribute Meaning __doc__ The function’s documentation string, or$_{None}$ if unavailable; not inherited by subclasses. Writable __name__ The function’s name. Writable __qualname__ The function’s qualified name . New in version 3.3. Writable __module__ The name of the module the function was defined in, or None if unavailable. Writable __defaults__ A tuple containing default argument values for those arguments that have defaults, or None if no arguments have a default value. Writable __code__ The code object representing the compiled function body. Writable __globals__ A reference to the dictionary that holds the function’s global variables — the global namespace of the module in which the function was defined. Read-only __dict__ The namespace supporting arbitrary function attributes. Writable __closure__ None or a tuple of cells that contain bindings for the function’s free variables. See below for information on the cell_contents attribute. Read-only __annotations__ A dict containing annotations of parameters. The keys of the dict are the parameter names, and 'return' for the return annotation, if provided. Writable $_{__kwdefaults__}$A dict containing defaults for keyword-only parameters. Writable Instance methods An instance method object combines a class, a class instance and any callable object (nor- mally a user-defined function). Most of the attributes labelled “Writable” check the type of the assigned value. Function objects also support getting and setting arbitrary attributes, which can be used, for example, to attach metadata to functions. Regular attribute dot-notation is used to get and set such attributes. Note that the current implementation only supports function attributes on user-defined functions. Function attributes on built-in functions may be supported in the future. Additional information about a function’s definition can be retrieved from its code object; see the de- scription of internal types below. The$_{cell}$type can be accessed in the$_{types}$module. A cell object has the attribute$_{cell_contents}$ . This can be used to get the value of the cell, as well as set the value. Special read-only attributes:$_{__self__}$ is the class instance object,$_{__func__}$ is the function object; __doc__ is the method’s documentation (same as$_{__func__.__doc__}$ );$_{__name__}$ is the method name (same as$_{__func__.__name__}$ );$_{__module__}$ is the name of the module the method was defined in, or$_{None}$ if unavailable. Methods also support accessing (but not setting) the arbitrary function attributes on the underlying func- tion object. User-defined method objects may be created when getting an attribute of a class (perhaps via an instance of that class), if that attribute is a user-defined function object or a class method object. When an instance method object is created by retrieving a user-defined function object from a class via one of its instances, its$_{__self__}$ attribute is the instance, and the method object is said to be bound. The new method’s$_{__func__}$ attribute is the original function object. When an instance method object is created by retrieving a class method object from a class or instance, its$_{__self__}$ attribute is the class itself, and its$_{__func__}$ attribute is the function object underlying the class method. When an instance method object is called, the underlying function ($_{__func__}$ ) is called, inserting the class instance ($_{__self__}$ ) in front of the argument list. For instance, when$_{C}$ is a class which contains a