Is there a way to change default_factory to the defaultdict value (the value that is returned when a nonexistent key is called) after it has been created?
For example, when the defaultdict parameter, for example
d = defaultdict(lambda:1)
d will return 1 whenever a nonexistent key is called, for example d['absent'] . How was this default value changed to another value (e.g. 2) after this initial definition?
source share