mirror of
https://github.com/python/cpython.git
synced 2025-10-01 04:42:10 +00:00
Issue #25689: Merge ftplib and nntplib docs from 3.5
This commit is contained in:
commit
d6a59bacd8
2 changed files with 3 additions and 4 deletions
|
@ -52,8 +52,7 @@ The module defines the following items:
|
||||||
will be used). *source_address* is a 2-tuple ``(host, port)`` for the socket
|
will be used). *source_address* is a 2-tuple ``(host, port)`` for the socket
|
||||||
to bind to as its source address before connecting.
|
to bind to as its source address before connecting.
|
||||||
|
|
||||||
:class:`FTP` class supports the :keyword:`with` statement. Here is a sample
|
The :class:`FTP` class supports the :keyword:`with` statement, e.g.:
|
||||||
on how using it:
|
|
||||||
|
|
||||||
>>> from ftplib import FTP
|
>>> from ftplib import FTP
|
||||||
>>> with FTP("ftp1.at.proftpd.org") as ftp:
|
>>> with FTP("ftp1.at.proftpd.org") as ftp:
|
||||||
|
|
|
@ -69,9 +69,9 @@ The module itself defines the following classes:
|
||||||
connecting to an NNTP server on the local machine and intend to call
|
connecting to an NNTP server on the local machine and intend to call
|
||||||
reader-specific commands, such as ``group``. If you get unexpected
|
reader-specific commands, such as ``group``. If you get unexpected
|
||||||
:exc:`NNTPPermanentError`\ s, you might need to set *readermode*.
|
:exc:`NNTPPermanentError`\ s, you might need to set *readermode*.
|
||||||
:class:`NNTP` class supports the :keyword:`with` statement to
|
The :class:`NNTP` class supports the :keyword:`with` statement to
|
||||||
unconditionally consume :exc:`OSError` exceptions and to close the NNTP
|
unconditionally consume :exc:`OSError` exceptions and to close the NNTP
|
||||||
connection when done. Here is a sample on how using it:
|
connection when done, e.g.:
|
||||||
|
|
||||||
>>> from nntplib import NNTP
|
>>> from nntplib import NNTP
|
||||||
>>> with NNTP('news.gmane.org') as n:
|
>>> with NNTP('news.gmane.org') as n:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue