How do you use name with a function that I'd like to pass a keyword argument through?
For example, I have the following function:
def func(keyword1='A'):
print keyword1
I can do this:
func.__name__
>> 'func'
But, I'd like to do this:
func(keyword1='B').__name__
>>> 'func'
The reason I'd like to do this is because I have another method that takes in this function as an argument and it needs to pull the name of the function and run that function with different keywords.
So, what I'm really trying to do is get this function to work:
def Function_Name_And_Result(x):
print x.__name__ + x()
Function_Name_And_Result(func(keyword1='B'))
>> funcB