• Programming,  Python

    [Python] Special Function

    Python은 class 구조로 대부분 이뤄져있으며, 각 class는 __init__ 과 같은 special function으로 구성된다. Pair(3, 4) __init__() __init__: 기존 class의 constructor 역할을 한다. __repr__() __repr__: class의 객체를 출력했을 때 호출되는 함수이다. 위 코드에서 'Pair({0.x!r},…