Source code for tablate.library.checkers.set_attr_resolver
from typing import Any
[docs]
def set_attr_resolver(instance: Any, attr: str, default: Any):
return instance.__getattribute__(attr) if hasattr(instance, attr) and instance.__getattribute__(attr) is not None else default