Python/ETC
[파이썬 기본 다지기] 파이썬에서의 Descriptor(디스크립터)의 역할 및 Non-Data Descriptor(비 데이터 디스크립터), Data Descriptor(데이터 디스크립터)와 Django(장고)에서의 model Field에서 살펴보기
1. 디스크립터란? 파이썬 공식 문서에서는 다음과 같이 디스크립터에서 간략하게 설명하고 있다. A descriptor is what we call any object that defines __get__(), __set__(), or __delete__().Optionally, descriptors can have a __set_name__() method. This is only used in cases where a descriptor needs to know either the class where it was created or the name of class variable it was assigned to. (This method, if present, is called even if the ..
2026. 1. 31. 16:22