반응형
immutable과 mutable
- immutable 객체
> 생성된 이후 수정 불가능
> 이미 존재하는 객체이더라도 새로운 객체를 생성하여 재생성
- mutable 객체 : 수정 가능한 객체
> 생성된 이후 수정 가능
> 이미 존재하는 객체에 재할당
파이썬에서의 immutable, mutable 객체
Immutable 객체 | int, float, str, tuple |
Mutable 객체 | list, dict |
참고 >
- 레벨업 파이썬 immutable과 mutable https://wikidocs.net/91520
- Java의 Mutable과 Immutable https://velog.io/@guswlsapdlf/Java%EC%9D%98-Mutable%EA%B3%BC-Immutable
반응형
'개발 > python' 카테고리의 다른 글
python. /와 // 차이 (0) | 2023.10.17 |
---|---|
python. set 과 dict 차이 (2) | 2023.10.05 |
python. 얕은복사와 깉은복사 (feat. 백준 15683) (0) | 2023.08.24 |
python. 띄어쓰기(개행문자) 없이 print 찍고 싶을때 (간단한 별찍기) (0) | 2022.12.11 |
python. __file__ 의미 (0) | 2021.07.28 |