Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass usingattributes

Reply
Thread Tools

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass usingattributes

 
 
Dave Cinege
Guest
Posts: n/a
 
      12-11-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:
g.cfg.host.cpu
fails recursion on 'host' you will see: g.cfg.host.cpu [2]
I know my code sent g.cfg.host.cpu. I know host failed. if It was
g.cfg.host.host, I'd know which host failed.

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass usingattributes Ian Kelly Python 0 12-11-2012 10:20 PM
Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass usingattributes Ian Kelly Python 0 12-11-2012 09:53 PM
Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass usingattributes Dave Cinege Python 0 12-11-2012 08:57 PM
Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass usingattributes Ian Kelly Python 0 12-11-2012 06:41 AM
Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass usingattributes Jason Friedman Python 0 12-11-2012 04:08 AM



Advertisments