>>> charles = {‘name’: ‘Charles L. Dodgson’, ‘born’: 1832}
>>> lewis = charles ❶
>>> lewis is charles
True
>>> id(charles), id(lewis) ❷
(4300473992, 4300473992)
>>> lewis[‘balance’] = 950 ❸
>>> charles
{‘name’: ‘Charles L. Dodgson’, ‘born’: 1832, ‘balance’: 950}
❶
lewis
는
charles
의 별칭이다.
❷
is
연산자와
id
()
함수로 이 사실을 확인한다.
❸
lewis
에 항목을 추가하는 것은
charles
에 항목을 추가하는 것과 마찬가지다.
그런데 예를 들어 다른 누군가(알렉산더 페다첸코
Alexander
Pedachenko
박사라고 하자)가 자신이
1832
년에 태어난 찰스
L
. 도지슨이라고 사칭한다고 가정하자. 그의 자격 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.