ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

Dave Cinege dave at
Wed Dec 12 00:10:08 CET 2012

On Tuesday 11 December 2012 17:39:12 Dave Cinege wrote:

My memory is getting jogged more why did some things:

raise KeyError(key + ' [%s]' % i)

I did this to specificly give you the indice that failed recursion but provide 
the entire key name as it was provided to __getitem__

So if:
fails recursion on 'host' you will see: [2]
I know my code sent I know host failed. if It was, I'd know which host failed.

Makes sense to me. Works for me. Sure there are other ways to do it.

More information about the Python-list mailing list