파이썬[Python]: 내장함수 - __setattr__ 메서드
파이썬(Phthon): 내장함수 - __setattr__ 메서드(method)    /// 설명  클래스의 속성(attribute)에 값을 할당하고자 할 경우 호출 됩니다.   ※ 형식  object.__setattr__(self, name, value)  reference  https://docs.python.org/3/reference/datamodel.html#object.__setattr__    /// 예제   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 class  A:      def  __init__( self , a):          self .a  =  a        def  __setattr__( self , attr, value):         value  =  f 'attribute: {attr}, value: {value}'          super ().__setattr__(attr, value)          # object.__setattr__(self, attr, value)     a  =  A( 'String' ) print (a.a)   # attribute: a, value: String a.a  =   'a' ...