본문 바로가기

youngfromnowhere

검색하기
youngfromnowhere
프로필사진 곽일땡

  • 분류 전체보기 (41)
    • Java (8)
      • spring (0)
    • Python (10)
      • django (0)
      • flask (1)
    • Linux Shell (5)
    • JavaScript (2)
    • Git (2)
    • HTML&CSS (0)
    • Vim (5)
    • TIL&WIL (0)
    • CS&Concepts (2)
    • Algorithms (0)
    • PHP&Apache2 (5)
      • PHP (4)
      • Apache2 (1)
    • Database (1)
      • MySQL&MariaDB (1)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/12   »
일 월 화 수 목 금 토
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 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Python (11)

youngfromnowhere

[Python] Python의 Method Call

Class 내부에 정의된 method를 호출하는 방법에는 두 가지가 있다. 첫 번째는 method명 앞에 instance명을 prefix로 붙이는 것이다. 즉, object 'my_object'가 class 'MyClass'의 instance이고, MyClass 내에 '__mymethod__'가 정의된 경우. my_object.__mymethod__() 로 method를 호출할 수 있다. 두 번째는 class명을 prefix로 붙이고, instance를 argument로 입력하는 것이다. MyClass.__mymethod__(my_object) 사실 첫 번째 method call은 python 내부에서 두 번째 형식에 맞게 변환된다. my_object.__mymethod__() => type(my_obj..

Python 2022. 10. 31. 19:44
이전 Prev 1 2 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바