]> granicus.if.org Git - python/commitdiff
MERGE: Closes #16789: :meth:`quit` links to constants instead of own module
authorJesus Cea <jcea@jcea.es>
Wed, 26 Dec 2012 15:47:40 +0000 (16:47 +0100)
committerJesus Cea <jcea@jcea.es>
Wed, 26 Dec 2012 15:47:40 +0000 (16:47 +0100)
1  2 
Doc/library/ftplib.rst
Doc/library/smtplib.rst

Simple merge
index 711981f3e24cbe8c11540db6801dcf71c8ffab5a,4a539fc5021060d94ea91aaf56811237a4a5d3ca..40b2561c6b26dd6a8b885518443f509e9fc6bd9c
@@@ -29,34 -29,14 +29,35 @@@ Protocol) and :rfc:`1869` (SMTP Servic
     raised if the specified host doesn't respond correctly. The optional
     *timeout* parameter specifies a timeout in seconds for blocking operations
     like the connection attempt (if not specified, the global default timeout
 -   setting will be used).
 +   setting will be used). The optional source_address parameter allows to bind to some
 +   specific source address in a machine with multiple network interfaces,
 +   and/or to some specific source TCP port. It takes a 2-tuple (host, port),
 +   for the socket to bind to as its source address before connecting. If
 +   omitted (or if host or port are ``''`` and/or 0 respectively) the OS default
 +   behavior will be used.
  
     For normal use, you should only require the initialization/connect,
-    :meth:`sendmail`, and :meth:`quit` methods.  An example is included below.
+    :meth:`sendmail`, and :meth:`~smtplib.quit` methods.
+    An example is included below.
  
 +   The :class:`SMTP` class supports the :keyword:`with` statement.  When used
 +   like this, the SMTP ``QUIT`` command is issued automatically when the
 +   :keyword:`with` statement exits.  E.g.::
  
 -.. class:: SMTP_SSL(host='', port=0, local_hostname=None, keyfile=None, certfile=None[, timeout])
 +    >>> from smtplib import SMTP
 +    >>> with SMTP("domain.org") as smtp:
 +    ...     smtp.noop()
 +    ...
 +    (250, b'Ok')
 +    >>>
 +
 +   .. versionchanged:: 3.3
 +      Support for the :keyword:`with` statement was added.
 +
 +   .. versionchanged:: 3.3
 +      source_address argument was added.
 +
 +.. class:: SMTP_SSL(host='', port=0, local_hostname=None, keyfile=None, certfile=None[, timeout], context=None, source_address=None)
  
     A :class:`SMTP_SSL` instance behaves exactly the same as instances of
     :class:`SMTP`. :class:`SMTP_SSL` should be used for situations where SSL is