mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Made more extensive usage of context managers with open.
This commit is contained in:
parent
ec5423df05
commit
865cd35c9b
33 changed files with 178 additions and 233 deletions
|
@ -239,9 +239,8 @@ Sample usage::
|
|||
... link=u"http://www.holovaty.com/test/",
|
||||
... description="Testing."
|
||||
... )
|
||||
>>> fp = open('test.rss', 'w')
|
||||
>>> feed.write(fp, 'utf-8')
|
||||
>>> fp.close()
|
||||
>>> with open('test.rss', 'w') as fp:
|
||||
>>> feed.write(fp, 'utf-8')
|
||||
|
||||
For simplifying the selection of a generator use ``feedgenerator.DefaultFeed``
|
||||
which is currently ``Rss201rev2Feed``
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue