[python] 인스턴스의 애트리뷰트 한번에 확인하는 함수

건너별·2022년 6월 22일
0

python

목록 보기
10/12

obj에 인스턴스 넣어서 확인

def check_instance(obj):
  for i in inspect.getmembers(obj):
        
      # to remove private and protected
      # functions
      if not i[0].startswith('_'):
            
          # To remove other methods that
          # doesnot start with a underscore
          if not inspect.ismethod(i[1]): 
              print(i)
profile
romantic ai developer

0개의 댓글