
storing only one copy of each distinct string value in memory
-5~256의 값은 각각의 객체가 1개
https://docs.python.org/3.8/c-api/long.html?highlight=fromlong#c.PyLong_FromLong
The current implementation keeps an array of integer objects for all integers between
-5and256, when you create an int in that range you actually just get back a reference to the existing object. `

optimizer의 precalculation

-5~256 범위의 int는 run-time 할당에도 intern된 값을 참조
-5~256의 integer를 가리키는 변수는 항상 기존에 interning된 값을 참조한다.a-z, A-Z, 0-9, _로만 이루어진 string
underscore가 아닌 space, hyphen이 들어간 string은 interning이 되지 않는다.

sys.intern() 으로 manually interning이 가능하다.>>> import sys
>>> s1 = "strin"
>>> s2 = s1 + "g"
>>> s2 is "string"
False
>>> sys.intern(s3) is "string"
Truehttps://stackabuse.com/guide-to-string-interning-in-python/
=가 아닌 is로 비교intern() 함수의 호출 비용이 높음 (interned table을 계속 관리해야하는 소요)