The interpreter supports several other kinds of objects. Most of these support only one or two operations.
The only special operation on a module is attribute access:
m is a module and
accesses a name defined in
symbol table. The
import statement is not,
strictly speaking, an operation on a module object;
require a module object named
foo to exist, rather
it requires an (external) definition for a module named
A special member of every module is
This is the dictionary containing the module’s symbol table.
Modifying this dictionary changes the module’s symbol table,
but direct assignment to the
isn’t possible (i.e., you can write
m.a to be 1, but you can’t write
Modules built into the interpreter are written like this:
(built-in)>. If loaded from a file, they are
See Chapters 3 and 7 of the Python reference manual.
Function objects are created by function definitions. The only
operation on a function object is to call it:
There are really two flavors of function objects, built-in functions and user-defined functions. Both support the same operation (to call the function), but the implementation is different, hence the different object types.
The implementation adds two special read-only ...