Is there an “infinite dictionary” in Python?
问题 Is there something like an "infinite dictionary" in Python? More precisely, is there something where - i can put in values like in a dictionary, - but maybe also a function which tells me how to map a key to a value, - and maybe also something that maps a key to a (finite) set of keys and then gives the corresponding value? Formulated in another way, what I want to have is the following "thing": I initialize it in a way (give values, functions, whatever) and then it just gives me for each key