diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/files/file.txt | 7 | ||||
| -rw-r--r-- | docs/releases/2.0.txt | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/docs/ref/files/file.txt b/docs/ref/files/file.txt index d99e1add2c..5e447bd1ca 100644 --- a/docs/ref/files/file.txt +++ b/docs/ref/files/file.txt @@ -56,8 +56,11 @@ The ``File`` class was originally opened with; ``None`` means to reopen with the original mode. - Returns ``self``, so that it can be used similar to Python's - built-in :func:`python:open()` with the ``with`` statement. + It can be used as a context manager, e.g. ``with file.open() as f:``. + + .. versionchanged:: 2.0 + + Context manager support was added. .. method:: __iter__() diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index 044123485d..0d2b2d77ed 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -150,7 +150,8 @@ Email File Storage ~~~~~~~~~~~~ -* ... +* :meth:`File.open() <django.core.files.File.open>` can be used as a context + manager, e.g. ``with file.open() as f:``. File Uploads ~~~~~~~~~~~~ |
