Using the view that functions are objects, partial applications can be realized by writing a function, which itself returns a new function, with a reduced number of input arguments. For instance, the function make_sine could be defined as follows:
def make_sine(freq): "Make a sine function with frequency freq" def mysine(t): return sin_omega(t, freq) return mysine
In this example, the inner function mysine has access to the variable freq; it is neither a local variable of this function nor is it passed to it via the argument list. Python allows such a construction, see Section 13.1, Namespaces.