I want to check all of my argument values so I can convert the value to None if it's an empty string.
I figured out how to get the list of arguments, but I can't figure out how to get the value of the argument.
What I have now is this:
def __init__(self, first, middle, last):
# convert blank attributes to None
import inspect
args = inspect.getargspec(self.__init__)[0]
for arg in args:
print 'arg: ' + str(arg)
if arg == '':
arg = None
This gets the argument names, but not their values. How can I get a hold of the values?