Can dictionary values access their keys?

Matthew Thorley ruach at chpc.utah.edu
Fri Apr 8 14:19:16 EDT 2005


Steve Holden wrote:

> I think that since each Datapoint appears to be unique, the simplest
> thing to do is to include a reference to the parent object as an
> attribute of the datapoint. Presumably when you create the Datapoint you
> already know which Device and Mib it's going to be stored in, so why
> make work for yourself when you can trade a little storage and make the
> whole thing easy?
>

I'll give that a shot and see how it goes. It makes sense, the parent
objects create the child objects, so they could very easily set the
apropriate parameter.

On the other hand, the introspecitve stuff is cool! When you say "make
more work for yourself" are you talking about 400 lines of code or 50.
Further, is there much processing required to do the magic? When python
do introspective magic, is it memory intensive? by that I mean does it
have to make copies of the objects to do the look-ups?

I don't mind copying the info like you suggest, but if the extra work
won't take more than a day or two, (or maybe even a week if its fun) I'd
like to do the introspection so that 1: I know how, 2: I can say that I
did ;)

Is there any kind of documentaion, (refference, article, blog-post,
tutorial), that explains introspection in useful detail, or at least
enough to get me started?

> You might also be interested to know that the Python Software Foundation
> funded the development of a Python package to support SNMP as a part of
> its first round of grant funding last year, so there's at least one
> other person working on this stuff!
> 
I did see that and I was quite pleased! :) I am currently using the
authors 'old' pysnmp which gets me by, but I am very excited to try out
the new version when it is ready.


Thanks again, for the reply and for the grant to pysnmp!

-Matthew



More information about the Python-list mailing list