python 값복사, 참조복사
리스트, 딕셔너리, Queue 의 경우 참조복사 [ 참조복사를 피하고 싶으면 copy lib 이용 필요 ] bool 타입, int, str 은 값복사 import copy import queue class AA(): def aa(self): q = False w = 1 e = 'a' r = {1: 2} t = [1, 2] y = queue.Queue() y.put(1) u = {1: 2} self.bb(q, w, e, r, t, y, u) print(q) # 출력값 : False print(w) # 출력값 : 1 print(e) # 출력값 : a print(r) # 출력값 : {1: 2, 3: 4} print("--------------------------------------") # ---------..
2024. 4. 1.