Recently I was describing my code to my Uni teacher, it was something like this:
def f(x):
return x*x
def map_list(function, list):
return [function(element) for element in list]
map_list(f, [1,2,3])
and I told that in map_list(f, [1,2,3])
, f
argument is a pointer to the function, which is obviously wrong, as there are no pointers really in PYthon. I was trying to figure it out, but I couldn't find any clear answer. So, what is it? Reference, object, or something else?
Thanks in advance.