Just what the title says, I'm trying to figure out if you can parametrize a method being call via dot notation.
def funk(x,a_class_method):
return [i.a_class_method() for i in x]
a_class_method = upper
funk(x,a_class_method)
input
x = ['hi', 'my', 'name', 'is', 'frank']
desired output
['HI', 'MY', 'NAME', 'IS', 'FRANK']
As written this results in
NameError: name 'upper' is not defined