From 202894dd8fcf94c055db842a4f80167c566ab718 Mon Sep 17 00:00:00 2001 From: Ismael Carnales Date: Wed, 22 Jul 2009 10:25:22 -0300 Subject: [PATCH] fixes to newitem doc --- docs/experimental/topics/newitem/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/experimental/topics/newitem/index.rst b/docs/experimental/topics/newitem/index.rst index 2603bf0d7..816af939d 100644 --- a/docs/experimental/topics/newitem/index.rst +++ b/docs/experimental/topics/newitem/index.rst @@ -58,7 +58,7 @@ converted to the expected Python types depending of their class:: >>> item['content'] = u'Content' >>> item['published'] = '2009-07-08' >>> item - NewsItem({'headline': u'Headline', 'content': u'Content', 'published': datetime.date(2009, 7, 8)}) + NewsItem(headline=u'Headline', content=u'Content', published=datetime.date(2009, 7, 8)) Using this may seen complicated at first, but gives you much power over scraped data, like :ref:`topics-newitem-index-defaults`, @@ -97,7 +97,7 @@ you can use :meth:`Item.get` method to avoid this. >>> item['headline'] Traceback (most recent call last): ... - KeyError: 'content - >>> item.get('content') is None + KeyError: 'headline + >>> item.get('headline') is None True