if isinstance(attribute, Callable):
    return attribute()
elif isinstance(attribute, str):
    return attribute
elif isinstance(attribute, Container):
    pass
how to distinguish between a method and an attribute in python by name