I am learning a tutorial on python.It is explaining how functions are first class objects in Python.
def foo():
pass
print(foo.__class__)
print(issubclass(foo.__class__,object))
The output that I get for the above code is
<type 'function'>
True
This program is supposed to demonstrate that functions are first class objects in python? My questions are as follows.
- How does the above code prove that functions are fist class objects?
- What are the attributes of a first class object?
- what does
function.__class__
signify? It returns a tuple<type,function>
which doesn't mean much?