Interning On Request
This runs under CPython.
import sys
a = "".join(["ke", "y"])
b = "".join(["ke", "y"])
print(a is b)
a2 = sys.intern(a)
b2 = sys.intern(b)
print(a2 is b2)
What do the two print calls output?
Sign in to answer questions and track your progress
Sign In