Skip to content

Commit 058ab0a

Browse files
committed
Doc: Add iterator reference and anchor to range() documentation
1 parent 54907a0 commit 058ab0a

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

Doc/library/functions.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,10 @@ are always available. They are listed here in alphabetical order.
17351735

17361736
Rather than being a function, :class:`range` is actually an immutable
17371737
sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`.
1738-
1738+
1739+
The object returned by :class:`range` is an :term:`iterator` and supports iteration.
1740+
See also :ref:`iterator` for more information about iterators and how to implement
1741+
custom iterable classes.
17391742

17401743
.. function:: repr(object)
17411744

Doc/library/smtplib.rst

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
2424
.. class:: SMTP(host='', port=0, local_hostname=None[, timeout], source_address=None)
2525

2626
An :class:`SMTP` instance encapsulates an SMTP connection. It has methods
27-
that support a full repertoire of SMTP and ESMTP operations.
28-
If *host* is omitted or set to an empty string, no connection is made during initialization; you must
29-
call :meth:`connect` manually before using the instance.
30-
If *port* is zero,the value of the :attr:`default_port` attribute is used.
31-
32-
If specified, *local_hostname* is used as the FQDN of the local host in the HELO/EHLO
27+
that support a full repertoire of SMTP and ESMTP operations. If the optional
28+
*host* and *port* parameters are given, the SMTP :meth:`connect` method is
29+
called with those parameters during initialization. If specified,
30+
*local_hostname* is used as the FQDN of the local host in the HELO/EHLO
3331
command. Otherwise, the local hostname is found using
3432
:func:`socket.getfqdn`. If the :meth:`connect` call returns anything other
3533
than a success code, an :exc:`SMTPConnectError` is raised. The optional
@@ -83,13 +81,9 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
8381
An :class:`SMTP_SSL` instance behaves exactly the same as instances of
8482
:class:`SMTP`. :class:`SMTP_SSL` should be used for situations where SSL is
8583
required from the beginning of the connection and using :meth:`starttls` is
86-
not appropriate. If the optional *host* and *port* parameters are given, the
87-
SMTP_SSL :meth:`connect` method is called with those parameters during initialization.
88-
If *host* is omitted or an empty string, no connection is made during initialization;
89-
you must call :meth:`connect` manually before using the instance. If
90-
*port* is zero, the standard SMTP-over-SSL port (465) is used.
91-
92-
The optional arguments *local_hostname*, *timeout* and *source_address* have the same
84+
not appropriate. If *host* is not specified, the local host is used. If
85+
*port* is zero, the standard SMTP-over-SSL port (465) is used. The optional
86+
arguments *local_hostname*, *timeout* and *source_address* have the same
9387
meaning as they do in the :class:`SMTP` class. *context*, also optional,
9488
can contain a :class:`~ssl.SSLContext` and allows configuring various
9589
aspects of the secure connection. Please read :ref:`ssl-security` for

0 commit comments

Comments
 (0)