파이썬에서 더블 언더스코어(__)로 명명되는 메서드가 무수히 존재하는데, 이를 '매직 메서드'라고
칭하고 '던더 메서드'라고 표현되기도 한다.
* 참고
Python Magic methods are the methods starting and ending with double underscores ‘__’.
They are defined by built-in classes in Python and commonly used for operator overloading.
They are also called Dunder methods, Dunder here means “Double Under (Underscores)”.
Python Magic Methods
Built in classes define many magic methods, dir() function can show you magic methods
inherited by a class.
https://www.geeksforgeeks.org/dunder-magic-methods-python/
반응형
'IT > Programming' 카테고리의 다른 글
[Python] pypi-search를 통한 PyPI 패키지 정보 조회 (0) | 2024.04.27 |
---|---|
[Python] CLI 인터프리터 환경 Tab/자동 완성 (0) | 2024.04.14 |
[Python] sorted 함수, sort 메서드 정렬 시 key 함수 활용 용례 (0) | 2024.04.12 |
[Python] Docstring 정보 출력 (0) | 2024.04.10 |
[Python] Dictionary의 값이 List 타입일 때 Append 메서드 용례 (0) | 2024.04.09 |