結果 : how to check if class has attribute python