Remove almost all unpaired backticks in docstrings (#119231)

As reported in #117847 and #115366, an unpaired backtick in a docstring
tends to confuse e.g. Sphinx running on subclasses of standard library
objects, and the typographic style of using a backtick as an opening
quote is no longer in favor. Convert almost all uses of the form

    The variable `foo' should do xyz

to

    The variable 'foo' should do xyz

and also fix up miscellaneous other unpaired backticks (extraneous /
missing characters).

No functional change is intended here other than in human-readable
docstrings.
This commit is contained in:
Geoffrey Thomas 2024-05-22 12:35:18 -04:00 committed by GitHub
parent 81865002ae
commit ef172521a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 172 additions and 172 deletions

View file

@ -21,7 +21,7 @@ Charset = _charset.Charset
SEMISPACE = '; '
# Regular expression that matches `special' characters in parameters, the
# Regular expression that matches 'special' characters in parameters, the
# existence of which force quoting of the parameter value.
tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]')
@ -141,7 +141,7 @@ class Message:
multipart or a message/rfc822), then the payload is a list of Message
objects, otherwise it is a string.
Message objects implement part of the `mapping' interface, which assumes
Message objects implement part of the 'mapping' interface, which assumes
there is exactly one occurrence of the header per message. Some headers
do in fact appear multiple times (e.g. Received) and for those headers,
you must use the explicit API to set or get all the headers. Not all of
@ -597,7 +597,7 @@ class Message:
"""Return the message's content type.
The returned string is coerced to lower case of the form
`maintype/subtype'. If there was no Content-Type header in the
'maintype/subtype'. If there was no Content-Type header in the
message, the default type as given by get_default_type() will be
returned. Since according to RFC 2045, messages always have a default
type this will always return a value.
@ -620,7 +620,7 @@ class Message:
def get_content_maintype(self):
"""Return the message's main content type.
This is the `maintype' part of the string returned by
This is the 'maintype' part of the string returned by
get_content_type().
"""
ctype = self.get_content_type()
@ -629,14 +629,14 @@ class Message:
def get_content_subtype(self):
"""Returns the message's sub-content type.
This is the `subtype' part of the string returned by
This is the 'subtype' part of the string returned by
get_content_type().
"""
ctype = self.get_content_type()
return ctype.split('/')[1]
def get_default_type(self):
"""Return the `default' content type.
"""Return the 'default' content type.
Most messages have a default content type of text/plain, except for
messages that are subparts of multipart/digest containers. Such
@ -645,7 +645,7 @@ class Message:
return self._default_type
def set_default_type(self, ctype):
"""Set the `default' content type.
"""Set the 'default' content type.
ctype should be either "text/plain" or "message/rfc822", although this
is not enforced. The default content type is not stored in the
@ -678,8 +678,8 @@ class Message:
"""Return the message's Content-Type parameters, as a list.
The elements of the returned list are 2-tuples of key/value pairs, as
split on the `=' sign. The left hand side of the `=' is the key,
while the right hand side is the value. If there is no `=' sign in
split on the '=' sign. The left hand side of the '=' is the key,
while the right hand side is the value. If there is no '=' sign in
the parameter the value is the empty string. The value is as
described in the get_param() method.
@ -839,9 +839,9 @@ class Message:
"""Return the filename associated with the payload if present.
The filename is extracted from the Content-Disposition header's
`filename' parameter, and it is unquoted. If that header is missing
the `filename' parameter, this method falls back to looking for the
`name' parameter.
'filename' parameter, and it is unquoted. If that header is missing
the 'filename' parameter, this method falls back to looking for the
'name' parameter.
"""
missing = object()
filename = self.get_param('filename', missing, 'content-disposition')
@ -854,7 +854,7 @@ class Message:
def get_boundary(self, failobj=None):
"""Return the boundary associated with the payload if present.
The boundary is extracted from the Content-Type header's `boundary'
The boundary is extracted from the Content-Type header's 'boundary'
parameter, and it is unquoted.
"""
missing = object()