Only allowing default values for hashable keys would be problematic. However, accepting a Mapping wouldn’t force that, since any use case where keys aren’t required to be hashable for the subscript lookup step would be able to use that same data structure to hold the default values.
The defaults could be a dual mapping-or-iterable arg, where if the value isn’t a mapping, it must be an iterable with the following rules:
- defaults iterable shorter than subscripts iterable: keys processed after the defaults iterator is exhausted have no default values
- defaults iterable longer than subscripts iterable: extra values are ignored (allows use of itertools.repeat)