When you do something in the REPL console, the string will be compiled inside and during the compilation process, Python creates an intermediate list with a list of strings except for tokens. So this is reference number 1. You can check it as follows
import gc
print gc.get_referrers(10000)
# [['sys', 'dis', 'gc', 'gc', 'get_referrers', 10000], (-1, None, 10000)]
Since its just a digit, during the compilation process, the Python peep-hole optimizer saves the number as one of the constants in the generated bytecode. You can check it as follows
print compile("sys.getrefcount(10000)", "<string>", "eval").co_consts
Note:
, Python 10000 , . .
print eval("sys.getrefcount(10000)")
print eval(compile("sys.getrefcount(10000)", "<string>", "eval"))
compile eval. . , , - sys.getrefcount.