-
python inheritence (phython의 class의 constructor( init 객체지향(object oriented player))파이썬_장고 2024. 11. 26. 12:47
python에는 construct없이 init 이 있음. self는 class자체임
아래) first argument로 self 꼭 받아야가능
human function부르는방법 super init
name을 필요로함
super class = human
super은 상속하는 클래스에 접근할수 있는 권한을 줌
상속중인 init 매써드를 호출 이경우는 human
아래) 매서드 - 오버라이딩 -문자열로 나오게 하기
아래) class가 str super매서드 갖고있음
아래) underscore, underscore 매서드
아래) dir는 디렉터리를 의미해. 클래스의 속성들과 매서드를 보여줌
아래) 오버라이딩: name대신 이모지를 return
property jia.name호출해도 이모지 나옴
getattribute
'파이썬_장고' 카테고리의 다른 글
django run (1) 2024.11.28 장고 = 버블 (0) 2024.11.22 git init (0) 2024.11.21