[Python] List에는 최대 몇 개의 요소를 넣을 수 있을까?
# max size of list with incremental integers: 59,635,723
# max size of list with constant value '0': 120,898,753
# max size of list with appending copied sub-lists filled with '0': 462,200,000 (= 4622 * 100000)
# max size of list with extending copied sub-lists filled with '0': 166,200,000 (= 1662 * 100000)
# max size of list with extending copied sub-lists filled with '0': 123,460,000 (= 12346 * 10000)
# max size of list with extending copied sub-lists filled with '0': 135,000,000 (= 135 * 1000000)
# max size of list with extending copied sub-lists filled with '0': 163,400,000 (= 817 * 200000)
val_list_temp = [0 for i in range(1, 200000)]
for n in range(0, 100000):
print("n = ", n)
val_list += val_list_temp
exit("Successfully finished with no overflow. list len = %d" % len(val_list))
시험 삼아 몇 조건을 돌려봤지만 어떤 선형관계가 나올 것처럼 보이진 않는다. (사실 위 숫자들도 정확한 건 아님. loop 숫자에 sub loop 크기를 곱한 것이라...)