프로그램언어/Python (1) 썸네일형 리스트형 파이썬 코딩스타일 Class _ convention class Price: def __init__(self, price): self._price = price def _double_price(self): return self._price * self_hidden_factor def get_double_price(self): return self._double_price() 모듈 내에서만 사용하는 private 클래스/함수/변수/메서드를 선언할 때 _ 으로 시작한다. from module import * 으로 임포트할 때 이 컨벤션으로 시작한 것들은 무시가 된다. 다만, weak internal use indicator 라고 부르며 직접 가져다가 쓰는것은 가능한 정도로 완전한 private 을 강조할 수는 없다. self .. 이전 1 다음