On Oct 22, 4:17 am, Peter Otten <__pete...@web.de> wrote: > I just read the recipe, and it looks good to me except for the len() and > iter() implementations: > > >>> a = Context() > >>> a["x"] = 1 > >>> b = a.new_child() > >>> b["x"] = 2 > >>> len(b) > 2 > >>> b.keys() > > ['x', 'x'] > > I would have expected equal keys to occur/count just once.
Thanks for reviewing the recipe. Since only the first (unshadowed) 'x' is accessible, I can see why it would make sense to count it only once. Raymond -- http://mail.python.org/mailman/listinfo/python-list