class Test:


    class getStringClass:

        def __call__(self, var):
            setattr(self, 'string', var)
return self

def __init__(self):
    pass
Can you set an attribute to a method in python