Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #34664 > unrolled thread

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

Started byDave Cinege <dave@cinege.com>
First post2012-12-11 18:10 -0500
Last post2012-12-11 18:10 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes Dave Cinege <dave@cinege.com> - 2012-12-11 18:10 -0500

#34664 — Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

FromDave Cinege <dave@cinege.com>
Date2012-12-11 18:10 -0500
SubjectRe: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes
Message-ID<mailman.757.1355267415.29569.python-list@python.org>
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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web