Skip to content

Commit 74eda76

Browse files
committed
#27893: arg name and bytes references in email.parser docs.
Perhaps the BytesParser 'text' argument should really be bytes, but it hasn't been, it has been text, so for backward compatibility and for consistency with the regular Parser class, I'm keeping it as 'text'.
1 parent 3399e1e commit 74eda76

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Doc/library/email.parser.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ have the same API as the :class:`Parser` and :class:`BytesParser` classes.
202202
reading the headers or not. The default is ``False``, meaning it parses
203203
the entire contents of the file.
204204

205-
.. method:: parsebytes(bytes, headersonly=False)
205+
.. method:: parsebytes(text, headersonly=False)
206206

207-
Similar to the :meth:`parse` method, except it takes a byte string object
208-
instead of a file-like object. Calling this method on a byte string is
209-
exactly equivalent to wrapping *text* in a :class:`~io.BytesIO` instance
210-
first and calling :meth:`parse`.
207+
Similar to the :meth:`parse` method, except it takes a :term:`bytes-like
208+
object` instead of a file-like object. Calling this method is equivalent
209+
to wrapping *text* in a :class:`~io.BytesIO` instance first and calling
210+
:meth:`parse`.
211211

212212
Optional *headersonly* is as with the :meth:`parse` method.
213213

@@ -233,7 +233,7 @@ in the top-level :mod:`email` package namespace.
233233
.. function:: message_from_bytes(s, _class=email.message.Message, *, \
234234
policy=policy.compat32)
235235

236-
Return a message object structure from a byte string. This is exactly
236+
Return a message object structure from a :term:`bytes-like object`. This is exactly
237237
equivalent to ``BytesParser().parsebytes(s)``. Optional *_class* and
238238
*strict* are interpreted as with the :class:`~email.parser.Parser` class
239239
constructor.

0 commit comments

Comments
 (0)