Given the following behaviour:
def a():
pass
type(a)
>> function
If type of a
is function
, what is type
of function
?
type(function)
>> NameError: name 'function' is not defined
And why does type
of type
from a
is type
?
type(type(a))
>> type
Lastly: if a
is an object
, why it cannot be inherited?
isinstance(a, object)
>> True
class x(a):
pass
TypeError: Error when calling the metaclass bases
function() argument 1 must be code, not str