Recent Posts
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- nerf
- ML
- dl
- FGVC
- REACT
- 알고리즘
- CV
- 딥러닝
- cs
- nlp
- GAN
- 자료구조
- 머신러닝
- Depth estimation
- Torch
- 3d
- SSL
- Python
- computervision
- classification
- Meta Learning
- pytorch
- math
- algorithm
- FineGrained
- web
- clean code
- Vision
- PRML
- Front
- Today
- Total
목록property (1)
KalelPark's LAB
[ CLEAN CODE ] Clean Python, Property 활용하기
Property - 파이썬에는 내장함수로 property()와 데코레이터인 @Property가 존재합니다. property()를 사용하면서 필드명을 사용하는 것처럼 메서드를 호출할 수 있습니다. class Person: def __init__(self, first_name, last_name, age): self.first_name = first_name self.last_name = last_name self.age = age def get_age(self): return self._age def set_age(self, age): if age < 0: raise ValueError("Invalid age") self._age = age age = property(get_age, set_age) pro..
Python/CLEAN CODE
2023. 1. 1. 20:37