본문 바로가기

부스트캠프 AI Tech/Python

Object Oriented Programming

 Class - Instance

  • snake_case : 함수/변수명
  • CamelCase : class명
class ClassName(object):
	def __init__ (self, name, age):
    	self.name = name # self = 생성된 instance
        self.age = age

Mangling

 

  • Inheritance - Super class의 attr, method를 Sub class가 물려 받음
  • Polymorphism - 같은 이름의 method를 다르게 구현(overriding, overloading)
  • Visibility(Encapsulation) - Class 간 간섭/정보공유 최소화

Property decorator

First-class object

  • variable, parameter, return 값으로 사용 가능한 객체, 함수
  • python의 모든 함수

Inner function

  • 함수 내에 또 다른 함수가 존재
  • closure : inner function을 return으로 반환

Decorator

  • method를 건드리지 않고 기능 추가

'부스트캠프 AI Tech > Python' 카테고리의 다른 글

Exception/File/Log handling  (0) 2022.01.21
Module  (0) 2022.01.21
Pythonic code  (0) 2022.01.19
Data Structure  (0) 2022.01.19
String  (0) 2022.01.19