728x90
객체가 클래스의 하위 인스턴스 인지 여부를 확인하는 Method.
ex)
isinstance(1, int) -> True 반환 ( 1은 int 클래스의 인스턴스이므로)
isinstance(1.4 , string) -> False 반환 (1.4는 string 클래스의 인스턴스가 아니므로)
마찬가지로
test=Test()
isinstance(test, Test) -> True
https://sonseungha.tistory.com/509
[python] isinstance
isinstance() 의 설명은 아래와 같습니다. Return whether an object is an instance of a class or of a subclass thereof. A tuple, as in isinstance(x, (A, B, ...)), may be given as the target to check ag..
sonseungha.tistory.com
728x90
'Python' 카테고리의 다른 글
파이썬 특정 폴더의 하위폴더 및 파일 리스트 가져오기 (glob) (0) | 2021.08.26 |
---|---|
파이썬 map의 활용 (0) | 2021.08.22 |
Shell Script , parameter 전달 법 (0) | 2021.05.07 |
쉘스크립트 파일 sh 이용, 파이썬 파일 순차 실행 (0) | 2021.05.07 |
Matplotlib scatter colormaps (0) | 2021.05.07 |