def getattr_safe(obj, attr):
    return None if obj is None else getattr(obj, attr)
obj = 'hello'
result = getattr_safe(obj, 'split')()
Python's equivalent to null-conditional operator introduced in C# 6