Skip to content

Commit c08b89b

Browse files
committed
Fix parameter names of some email.utils functions in docs
The documented names did not match the real ones, so passing the argument by the documented keyword raised TypeError: * parseaddr(): address -> addr * parsedate(), parsedate_tz(), parsedate_to_datetime(): date -> data * mktime_tz(): tuple -> data
1 parent 0ada998 commit c08b89b

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎Doc/library/email.utils.rst‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ of the new API.
5757
begins with angle brackets, they are stripped off.
5858

5959

60-
.. function:: parseaddr(address, *, strict=True)
60+
.. function:: parseaddr(addr, *, strict=True)
6161

62-
Parse address -- which should be the value of some address-containing field such
62+
Parse *addr* -- which should be the value of some address-containing field such
6363
as :mailheader:`To` or :mailheader:`Cc` -- into its constituent *realname* and
6464
*email address* parts. Returns a tuple of that information, unless the parse
6565
fails, in which case a 2-tuple of ``('', '')`` is returned.
@@ -115,18 +115,18 @@ of the new API.
115115
Add *strict* optional parameter and reject malformed inputs by default.
116116

117117

118-
.. function:: parsedate(date)
118+
.. function:: parsedate(data)
119119

120120
Attempts to parse a date according to the rules in :rfc:`2822#section-3.3`. However,
121121
some mailers don't follow that format as specified, so :func:`parsedate` tries to
122-
guess correctly in such cases. *date* is a string containing an :rfc:`2822`
122+
guess correctly in such cases. *data* is a string containing an :rfc:`2822`
123123
date, such as ``"Mon, 20 Nov 1995 19:12:08 -0500"``. If it succeeds in parsing
124124
the date, :func:`parsedate` returns a 9-tuple that can be passed directly to
125125
:func:`time.mktime`; otherwise ``None`` will be returned. Note that indexes 6,
126126
7, and 8 of the result tuple are not usable.
127127

128128

129-
.. function:: parsedate_tz(date)
129+
.. function:: parsedate_tz(data)
130130

131131
Performs the same function as :func:`parsedate`, but returns either ``None`` or
132132
a 10-tuple; the first 9 elements make up a tuple that can be passed directly to
@@ -136,11 +136,11 @@ of the new API.
136136
UTC. Note that indexes 6, 7, and 8 of the result tuple are not usable.
137137

138138

139-
.. function:: parsedate_to_datetime(date)
139+
.. function:: parsedate_to_datetime(data)
140140

141141
The inverse of :func:`format_datetime`. Performs the same function as
142142
:func:`parsedate`, but on success returns a :class:`~datetime.datetime`;
143-
otherwise :exc:`ValueError` is raised if *date* contains an invalid value such
143+
otherwise :exc:`ValueError` is raised if *data* contains an invalid value such
144144
as an hour greater than 23 or a timezone offset not between -24 and 24 hours.
145145
If the input date has a timezone of ``-0000``, the ``datetime`` will be a naive
146146
``datetime``, and if the date conforms to the RFCs it will represent a
@@ -153,7 +153,7 @@ of the new API.
153153
.. versionadded:: 3.3
154154

155155

156-
.. function:: mktime_tz(tuple)
156+
.. function:: mktime_tz(data)
157157

158158
Turn a 10-tuple as returned by :func:`parsedate_tz` into a UTC
159159
timestamp (seconds since the Epoch). If the timezone item in the

0 commit comments

Comments
 (0)