Dont know what my class is called...

Adam W. AWasilenko at gmail.com
Sun Feb 17 18:07:02 EST 2008


I am using the xml.sax package, and I'm running into a little
problem.  When I use the parse(url, ContentHandler()) method, I don't
know what parse() is naming the instance of ContentHandler.

I have a sub-class of ContentHandler make a dictionary of what it
parses, but the problem is I don't know the name of instance for me to
get at it.  The only way I have gotten at my dict is to declare it a
global value, and I know that is not the right way to do it.

I though I would be clever and put "print self" inside the __int__
method of the ContentHandler sub-class, in hopes it would display its
given name, but it returned a rather useless: <__main__.FeedHandler
instance at 0x02D8B5D0>

So, any ideas on how to figure this out would be great.



More information about the Python-list mailing list