from string import ascii_letters
from random import choice

def make_str(length):
    return ''.join(choice(ascii_letters) for i in range(length))
test_dict = {make_str(10000000): i for i in range(5)}
Do Dictionaries have a key length limit?