5 lines
136 B
Python
5 lines
136 B
Python
def get_attr_or_callable(obj, name):
|
|
target = getattr(obj, name)
|
|
if callable(target):
|
|
return target()
|
|
return target
|