Objects other than built-in types or compiled module classes are created at runtime. Objects can be classes, instances, functions, and so on. We call an object's type to give us a new instance; or put in another way, we call a
type class to give us an instance of that type.
Key 5: Create function on runtime.
Let's first take a look at how function objects can be created. This will broaden our view. This process is done by interpreter behind the scenes when it sees a
def keyword. It compiles the code, which is shown as follows, and passes the code name arguments to the function class that returns an object:
>>> function_class = (lambda x:x).__class__ >>> function_class <class 'function'> >>> def ...