현재 개발중

  • 홈
  • study
  • some_day
  • 방명록

classmethod 1

[Python] classmethod vs staticmethod

정적메소드 정적 메소드라 함은 클래스에서 직접 접근할 수 있는 메소드이다 파이썬에서는 클래스에 직접 접근할 수 있는 메소드가 두 가지이다 정적메소드임에도 불구하고 인스턴스에서도 접근이 가능하다 class CustomClass: # instance method def add_instance_method(self, a,b): return a + b # classmethod @classmethod def add_class_method(cls, a, b): return a + b # staticmethod @staticmethod def add_static_method(a, b): return a + b 인스턴스 메소드를 클래스에서 바로 접근하기 >>> from static_method import Custom..

study/Python 🌼 2021.05.28
이전
1
다음
더보기
프로필사진

현재 개발중

  • 분류 전체보기 (80)
    • study (80)
      • TIL🐥 (52)
      • Project 🐾 (8)
      • JAVA 🦊 (10)
      • Linux 🐧 (2)
      • Node 🐯 (1)
      • Python 🌼 (7)

Tag

javascript, Practitioner, 프로그래머스, python, linux, AWS, string, 자격증, 아마존, MAC, exception, mysql, Spring, 객체, Cloud, Java, 코딩테스트, Amazon, SQL, 파이썬,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/06   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바