
July 27, 2022
4:54 a.m.
I don't see why you couldn't. I guess what they do depends if any of these have defaults? Which I think they do not in this case, right? If they were non vanilla dictionaries that had a default e.g. class SomeDict(dict): def __getitem__(self, item=None): return super().__getitem__(item) def __contains__(self, item=None): return super().__contains__(item) print(b[1]) would still print Undefined because print's first argument doesn't have a default. a in c would be False. c[a] would return c[None], which would raise an error here because None isn't in the mapping Again, I am not pro this idea, just answering the questions you're asking as I see them :)