Author r.david.murray
Recipients alex, daniel.urban, pitrou, r.david.murray, rhettinger
Date 2011-02-23.18:39:15
SpamBayes Score 3.74513e-06
Marked as misclassified No
Message-id <>
Yes, that's part of what I find more intuitive about it.  I think of the chainmap as a stack.  Perhaps if I had a different application (I would use it for either configuration or namespace management) I'd want a different API, but for those two the stack approach seems most natural to me.

In particular, since only the top dict can be updated, it seems most natural to pop it off the top of the stack in order to modify the next one down (and then push it back, if desired).  If instead the way to modify the next one down is to do parents, then I'm mutating the chainmap I just did the parents call on, but I'm not referencing that object, I'm referencing the one I got back from the parents call.  It just seems more natural that the mutation operations should be carried out via a single chainmap object by using pop and push rather than effectively modifying (potentially multiple) chainmap objects by manipulating other chainmap objects.  (Yes, I realize that it is really the underlying dicts that are being modified, but conceptually I'm thinking of the chainmap as a single data structure).
Date User Action Args
2011-02-23 18:39:16r.david.murraysetrecipients: + r.david.murray, rhettinger, pitrou, alex, daniel.urban
2011-02-23 18:39:16r.david.murraysetmessageid: <>
2011-02-23 18:39:15r.david.murraylinkissue11297 messages
2011-02-23 18:39:15r.david.murraycreate