[Zope] Mark Pilgrim's Feed Parser in Zope

Gabriel Genellina gagsl-zope at yahoo.com.ar
Wed Jul 26 22:39:29 EDT 2006

At Wednesday 26/7/2006 18:57, KJZZ Webmaster wrote:

>And you were right! This is not seen as as a valid dictionary (nor is it
>seen as a string):
>stuff = container.externalmethod(feedurl=feedurl)
>test = same_type(stuff, {})
>print test
>return printed
>returns "0"
>However, interestingly enough, if I copy and paste the all the text that
>is returned by the external method into the script, I am able to confirm
>that it is a dictionary:
>stuff= {'lastbuilddate': u'Mon, 24 Jul 2006 12:06:18 EDT', 
>u'subtitle': 'U.S.',
>u'generator': 'NPR/RSS Generator 2.0 etc...'}

In this case you are using the Python syntax to create a dictionary, 
so it's not a surprise when it *is* a dictionary...

Are you sure that your external method returns this *text*? It seems 
that you are looking at the string representation of some 
dictionary-like object. You can convert any dictionary-like object 
into a true dictionary using the builtin function dict:

   d = dict(an_object_that_acts_like_a_dictionary)

Gabriel Genellina
Softlab SRL 

Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 

More information about the Zope mailing list