4 ms·
Why would you want a collection of keys to behave like the mapping they came from? Why not pass around the dict itself, when you need access to the values? This
by dxdm 4y ago
Why would you want a collection of keys to behave like the mapping they came from? Why not pass around the dict itself, when you need access to the values? This seems like it extends the responsibilities of "keys" beyond what they should care about, and the mental overhead grows with it.
Or is this about read-only access? There are better, more explicit ways to accomplish that.