Skip to content

Commit 1ae56fb

Browse files
Issue python#21818: Fixed references to classes that have names matching with module
names.
1 parent cffc0f4 commit 1ae56fb

27 files changed

+124
-124
lines changed

Doc/library/array.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The module defines the following type:
7575

7676
.. data:: ArrayType
7777

78-
Obsolete alias for :class:`array`.
78+
Obsolete alias for :class:`~array.array`.
7979

8080
Array objects support the ordinary sequence operations of indexing, slicing,
8181
concatenation, and multiplication. When using slice assignment, the assigned
@@ -249,7 +249,7 @@ When an array object is printed or converted to a string, it is represented as
249249
empty, otherwise it is a string if the *typecode* is ``'c'``, otherwise it is a
250250
list of numbers. The string is guaranteed to be able to be converted back to an
251251
array with the same type and value using :func:`eval`, so long as the
252-
:func:`array` function has been imported using ``from array import array``.
252+
:class:`~array.array` class has been imported using ``from array import array``.
253253
Examples::
254254

255255
array('l')

Doc/library/configparser.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
single: ini file
2222
single: Windows ini file
2323

24-
This module defines the class :class:`ConfigParser`. The :class:`ConfigParser`
24+
This module defines the class :class:`~ConfigParser.ConfigParser`. The :class:`~ConfigParser.ConfigParser`
2525
class implements a basic configuration file parser language which provides a
2626
structure similar to what you would find on Microsoft Windows INI files. You
2727
can use this to write Python programs which can be customized by end users
@@ -74,12 +74,12 @@ For example::
7474
would resolve the ``%(dir)s`` to the value of ``dir`` (``frob`` in this case).
7575
All reference expansions are done on demand.
7676

77-
Default values can be specified by passing them into the :class:`ConfigParser`
77+
Default values can be specified by passing them into the :class:`~ConfigParser.ConfigParser`
7878
constructor as a dictionary. Additional defaults may be passed into the
7979
:meth:`get` method which will override all others.
8080

8181
Sections are normally stored in a built-in dictionary. An alternative dictionary
82-
type can be passed to the :class:`ConfigParser` constructor. For example, if a
82+
type can be passed to the :class:`~ConfigParser.ConfigParser` constructor. For example, if a
8383
dictionary type is passed that sorts its keys, the sections will be sorted on
8484
write-back, as will be the keys within each section.
8585

@@ -135,7 +135,7 @@ write-back, as will be the keys within each section.
135135

136136
.. class:: SafeConfigParser([defaults[, dict_type[, allow_no_value]]])
137137

138-
Derived class of :class:`ConfigParser` that implements a more-sane variant of
138+
Derived class of :class:`~ConfigParser.ConfigParser` that implements a more-sane variant of
139139
the magical interpolation feature. This implementation is more predictable as
140140
well. New applications should prefer this version if they don't need to be
141141
compatible with older versions of Python.
@@ -215,7 +215,7 @@ write-back, as will be the keys within each section.
215215
.. data:: MAX_INTERPOLATION_DEPTH
216216

217217
The maximum depth for recursive interpolation for :meth:`get` when the *raw*
218-
parameter is false. This is relevant only for the :class:`ConfigParser` class.
218+
parameter is false. This is relevant only for the :class:`~ConfigParser.ConfigParser` class.
219219

220220

221221
.. seealso::
@@ -279,7 +279,7 @@ RawConfigParser Objects
279279
list of potential configuration file locations (for example, the current
280280
directory, the user's home directory, and some system-wide directory), and all
281281
existing configuration files in the list will be read. If none of the named
282-
files exist, the :class:`ConfigParser` instance will contain an empty dataset.
282+
files exist, the :class:`~ConfigParser.ConfigParser` instance will contain an empty dataset.
283283
An application which requires initial values to be loaded from a file should
284284
load the required file or files using :meth:`readfp` before calling :meth:`read`
285285
for any optional files::
@@ -338,7 +338,7 @@ RawConfigParser Objects
338338

339339
If the given section exists, set the given option to the specified value;
340340
otherwise raise :exc:`NoSectionError`. While it is possible to use
341-
:class:`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters set to
341+
:class:`RawConfigParser` (or :class:`~ConfigParser.ConfigParser` with *raw* parameters set to
342342
true) for *internal* storage of non-string values, full functionality (including
343343
interpolation and output to files) can only be achieved using string values.
344344

@@ -394,7 +394,7 @@ RawConfigParser Objects
394394
ConfigParser Objects
395395
--------------------
396396

397-
The :class:`ConfigParser` class extends some methods of the
397+
The :class:`~ConfigParser.ConfigParser` class extends some methods of the
398398
:class:`RawConfigParser` interface, adding some optional arguments.
399399

400400

@@ -422,7 +422,7 @@ SafeConfigParser Objects
422422
------------------------
423423

424424
The :class:`SafeConfigParser` class implements the same extended interface as
425-
:class:`ConfigParser`, with the following addition:
425+
:class:`~ConfigParser.ConfigParser`, with the following addition:
426426

427427

428428
.. method:: SafeConfigParser.set(section, option, value)
@@ -480,7 +480,7 @@ An example of reading the configuration file again::
480480
if config.getboolean('Section1', 'a_bool'):
481481
print config.get('Section1', 'foo')
482482

483-
To get interpolation, you will need to use a :class:`ConfigParser` or
483+
To get interpolation, you will need to use a :class:`~ConfigParser.ConfigParser` or
484484
:class:`SafeConfigParser`::
485485

486486
import ConfigParser

Doc/library/cookie.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ in Cookie name (as :attr:`~Morsel.key`).
8282
The same security warning from :class:`SerialCookie` applies here.
8383

8484
A further security note is warranted. For backwards compatibility, the
85-
:mod:`Cookie` module exports a class named :class:`Cookie` which is just an
86-
alias for :class:`SmartCookie`. This is probably a mistake and will likely be
87-
removed in a future version. You should not use the :class:`Cookie` class in
88-
your applications, for the same reason why you should not use the
89-
:class:`SerialCookie` class.
85+
:mod:`Cookie` module exports a class named :class:`~Cookie.Cookie` which is
86+
just an alias for :class:`SmartCookie`. This is probably a mistake and will
87+
likely be removed in a future version. You should not use the
88+
:class:`~Cookie.Cookie` class in your applications, for the same reason why
89+
you should not use the :class:`SerialCookie` class.
9090

9191

9292
.. seealso::

Doc/library/cookielib.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ The following classes are provided:
100100
1) are treated according to the RFC 2965 rules. However, if RFC 2965 handling
101101
is turned off or :attr:`rfc2109_as_netscape` is ``True``, RFC 2109 cookies are
102102
'downgraded' by the :class:`CookieJar` instance to Netscape cookies, by
103-
setting the :attr:`version` attribute of the :class:`Cookie` instance to 0.
103+
setting the :attr:`version` attribute of the :class:`~cookielib.Cookie` instance to 0.
104104
:class:`DefaultCookiePolicy` also provides some parameters to allow some
105105
fine-tuning of policy.
106106

107107

108108
.. class:: Cookie()
109109

110110
This class represents Netscape, RFC 2109 and RFC 2965 cookies. It is not
111-
expected that users of :mod:`cookielib` construct their own :class:`Cookie`
111+
expected that users of :mod:`cookielib` construct their own :class:`~cookielib.Cookie`
112112
instances. Instead, if necessary, call :meth:`make_cookies` on a
113113
:class:`CookieJar` instance.
114114

@@ -146,7 +146,7 @@ CookieJar and FileCookieJar Objects
146146
-----------------------------------
147147

148148
:class:`CookieJar` objects support the :term:`iterator` protocol for iterating over
149-
contained :class:`Cookie` objects.
149+
contained :class:`~cookielib.Cookie` objects.
150150

151151
:class:`CookieJar` has the following methods:
152152

@@ -194,20 +194,20 @@ contained :class:`Cookie` objects.
194194

195195
.. method:: CookieJar.make_cookies(response, request)
196196

197-
Return sequence of :class:`Cookie` objects extracted from *response* object.
197+
Return sequence of :class:`~cookielib.Cookie` objects extracted from *response* object.
198198

199199
See the documentation for :meth:`extract_cookies` for the interfaces required of
200200
the *response* and *request* arguments.
201201

202202

203203
.. method:: CookieJar.set_cookie_if_ok(cookie, request)
204204

205-
Set a :class:`Cookie` if policy says it's OK to do so.
205+
Set a :class:`~cookielib.Cookie` if policy says it's OK to do so.
206206

207207

208208
.. method:: CookieJar.set_cookie(cookie)
209209

210-
Set a :class:`Cookie`, without checking with policy to see whether or not it
210+
Set a :class:`~cookielib.Cookie`, without checking with policy to see whether or not it
211211
should be set.
212212

213213

@@ -383,7 +383,7 @@ methods:
383383
:meth:`path_return_ok` is called for the cookie path. Otherwise,
384384
:meth:`path_return_ok` and :meth:`return_ok` are never called for that cookie
385385
domain. If :meth:`path_return_ok` returns true, :meth:`return_ok` is called
386-
with the :class:`Cookie` object itself for a full check. Otherwise,
386+
with the :class:`~cookielib.Cookie` object itself for a full check. Otherwise,
387387
:meth:`return_ok` is never called for that cookie path.
388388

389389
Note that :meth:`domain_return_ok` is called for every *cookie* domain, not just
@@ -516,7 +516,7 @@ all be assigned to.
516516
If true, request that the :class:`CookieJar` instance downgrade RFC 2109 cookies
517517
(ie. cookies received in a :mailheader:`Set-Cookie` header with a version
518518
cookie-attribute of 1) to Netscape cookies by setting the version attribute of
519-
the :class:`Cookie` instance to 0. The default value is :const:`None`, in which
519+
the :class:`~cookielib.Cookie` instance to 0. The default value is :const:`None`, in which
520520
case RFC 2109 cookies are downgraded if and only if RFC 2965 handling is turned
521521
off. Therefore, RFC 2109 cookies are downgraded by default.
522522

@@ -608,7 +608,7 @@ combinations of the above flags:
608608
Cookie Objects
609609
--------------
610610

611-
:class:`Cookie` instances have Python attributes roughly corresponding to the
611+
:class:`~cookielib.Cookie` instances have Python attributes roughly corresponding to the
612612
standard cookie-attributes specified in the various cookie standards. The
613613
correspondence is not one-to-one, because there are complicated rules for
614614
assigning default values, because the ``max-age`` and ``expires``
@@ -724,7 +724,7 @@ accessed using the following methods:
724724

725725
Set the value of the named cookie-attribute.
726726

727-
The :class:`Cookie` class also defines the following method:
727+
The :class:`~cookielib.Cookie` class also defines the following method:
728728

729729

730730
.. method:: Cookie.is_expired([now=None])

Doc/library/datetime.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,8 +1170,8 @@ Using datetime with tzinfo:
11701170

11711171
.. _datetime-time:
11721172

1173-
:class:`time` Objects
1174-
---------------------
1173+
:class:`.time` Objects
1174+
----------------------
11751175

11761176
A time object represents a (local) time of day, independent of any particular
11771177
day, and subject to adjustment via a :class:`tzinfo` object.

Doc/library/docxmlrpcserver.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
The :mod:`DocXMLRPCServer` module extends the classes found in
1818
:mod:`SimpleXMLRPCServer` to serve HTML documentation in response to HTTP GET
19-
requests. Servers can either be free standing, using :class:`DocXMLRPCServer`,
19+
requests. Servers can either be free standing, using :class:`~DocXMLRPCServer.DocXMLRPCServer`,
2020
or embedded in a CGI environment, using :class:`DocCGIXMLRPCRequestHandler`.
2121

2222

@@ -36,7 +36,7 @@ or embedded in a CGI environment, using :class:`DocCGIXMLRPCRequestHandler`.
3636

3737
Create a new request handler instance. This request handler supports XML-RPC
3838
POST requests, documentation GET requests, and modifies logging so that the
39-
*logRequests* parameter to the :class:`DocXMLRPCServer` constructor parameter is
39+
*logRequests* parameter to the :class:`~DocXMLRPCServer.DocXMLRPCServer` constructor parameter is
4040
honored.
4141

4242

@@ -45,7 +45,7 @@ or embedded in a CGI environment, using :class:`DocCGIXMLRPCRequestHandler`.
4545
DocXMLRPCServer Objects
4646
-----------------------
4747

48-
The :class:`DocXMLRPCServer` class is derived from
48+
The :class:`~DocXMLRPCServer.DocXMLRPCServer` class is derived from
4949
:class:`SimpleXMLRPCServer.SimpleXMLRPCServer` and provides a means of creating
5050
self-documenting, stand alone XML-RPC servers. HTTP POST requests are handled as
5151
XML-RPC method calls. HTTP GET requests are handled by generating pydoc-style

Doc/library/dumbdbm.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Dumbdbm Objects
8282
---------------
8383

8484
In addition to the methods provided by the :class:`UserDict.DictMixin` class,
85-
:class:`dumbdbm` objects provide the following methods.
85+
:class:`~dumbdbm.dumbdbm` objects provide the following methods.
8686

8787

8888
.. method:: dumbdbm.sync()

Doc/library/formatter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
.. index:: single: HTMLParser (class in htmllib)
1010

1111
This module supports two interface definitions, each with multiple
12-
implementations. The *formatter* interface is used by the :class:`HTMLParser`
12+
implementations. The *formatter* interface is used by the :class:`~HTMLParser.HTMLParser`
1313
class of the :mod:`htmllib` module, and the *writer* interface is required by
1414
the formatter interface.
1515

Doc/library/gzip.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The module defines the following items:
6767
*fileobj*, since you might wish to append more material after the compressed
6868
data. This also allows you to pass a :class:`~StringIO.StringIO` object opened for
6969
writing as *fileobj*, and retrieve the resulting memory buffer using the
70-
:class:`StringIO` object's :meth:`~StringIO.StringIO.getvalue` method.
70+
:class:`~StringIO.StringIO` object's :meth:`~StringIO.StringIO.getvalue` method.
7171

7272
:class:`GzipFile` supports iteration and the :keyword:`with` statement.
7373

Doc/library/htmllib.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ This module defines a class which can serve as a base for parsing text files
2424
formatted in the HyperText Mark-up Language (HTML). The class is not directly
2525
concerned with I/O --- it must be provided with input in string form via a
2626
method, and makes calls to methods of a "formatter" object in order to produce
27-
output. The :class:`HTMLParser` class is designed to be used as a base class
27+
output. The :class:`~HTMLParser.HTMLParser` class is designed to be used as a base class
2828
for other classes in order to add functionality, and allows most of its methods
2929
to be extended or overridden. In turn, this class is derived from and extends
3030
the :class:`SGMLParser` class defined in module :mod:`sgmllib`. The
31-
:class:`HTMLParser` implementation supports the HTML 2.0 language as described
31+
:class:`~HTMLParser.HTMLParser` implementation supports the HTML 2.0 language as described
3232
in :rfc:`1866`. Two implementations of formatter objects are provided in the
3333
:mod:`formatter` module; refer to the documentation for that module for
3434
information on the formatter interface.
@@ -70,7 +70,7 @@ The module defines a parser class and an exception:
7070

7171
.. exception:: HTMLParseError
7272

73-
Exception raised by the :class:`HTMLParser` class when it encounters an error
73+
Exception raised by the :class:`~HTMLParser.HTMLParser` class when it encounters an error
7474
while parsing.
7575

7676
.. versionadded:: 2.4
@@ -91,15 +91,15 @@ The module defines a parser class and an exception:
9191
Definition of replacement text for XHTML 1.0 entities.
9292

9393
Module :mod:`sgmllib`
94-
Base class for :class:`HTMLParser`.
94+
Base class for :class:`~HTMLParser.HTMLParser`.
9595

9696

9797
.. _html-parser-objects:
9898

9999
HTMLParser Objects
100100
------------------
101101

102-
In addition to tag methods, the :class:`HTMLParser` class provides some
102+
In addition to tag methods, the :class:`~HTMLParser.HTMLParser` class provides some
103103
additional methods and instance variables for use within tag methods.
104104

105105

@@ -173,7 +173,7 @@ additional methods and instance variables for use within tag methods.
173173

174174
This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``,
175175
and ``entitydefs``. ``entitydefs`` is used by the :mod:`htmllib` module to
176-
provide the :attr:`entitydefs` attribute of the :class:`HTMLParser` class. The
176+
provide the :attr:`entitydefs` attribute of the :class:`~HTMLParser.HTMLParser` class. The
177177
definition provided here contains all the entities defined by XHTML 1.0 that
178178
can be handled using simple textual substitution in the Latin-1 character set
179179
(ISO-8859-1).

Doc/library/io.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Another :class:`IOBase` subclass, :class:`TextIOBase`, deals with
4747
streams whose bytes represent text, and handles encoding and decoding
4848
from and to :class:`unicode` strings. :class:`TextIOWrapper`, which extends
4949
it, is a buffered text interface to a buffered raw stream
50-
(:class:`BufferedIOBase`). Finally, :class:`StringIO` is an in-memory
50+
(:class:`BufferedIOBase`). Finally, :class:`~io.StringIO` is an in-memory
5151
stream for unicode text.
5252

5353
Argument names are not part of the specification, and only the arguments of
@@ -180,7 +180,7 @@ Module Interface
180180

181181
It is also possible to use an :class:`unicode` or :class:`bytes` string
182182
as a file for both reading and writing. For :class:`unicode` strings
183-
:class:`StringIO` can be used like a file opened in text mode,
183+
:class:`~io.StringIO` can be used like a file opened in text mode,
184184
and for :class:`bytes` a :class:`BytesIO` can be used like a
185185
file opened in a binary mode.
186186

@@ -718,7 +718,7 @@ Text I/O
718718
After the underlying buffer has been detached, the :class:`TextIOBase` is
719719
in an unusable state.
720720

721-
Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not
721+
Some :class:`TextIOBase` implementations, like :class:`~io.StringIO`, may not
722722
have the concept of an underlying buffer and calling this method will
723723
raise :exc:`UnsupportedOperation`.
724724

@@ -834,13 +834,13 @@ Text I/O
834834
newlines are written as ``\n`` on all platforms, but universal
835835
newline decoding is still performed when reading.
836836

837-
:class:`StringIO` provides this method in addition to those from
837+
:class:`~io.StringIO` provides this method in addition to those from
838838
:class:`TextIOWrapper` and its parents:
839839

840840
.. method:: getvalue()
841841

842842
Return a ``unicode`` containing the entire contents of the buffer at any
843-
time before the :class:`StringIO` object's :meth:`close` method is
843+
time before the :class:`~io.StringIO` object's :meth:`close` method is
844844
called. Newlines are decoded as if by :meth:`~TextIOBase.read`,
845845
although the stream position is not changed.
846846

@@ -902,7 +902,7 @@ if you handle huge amounts of text data (for example very large log files).
902902
Also, :meth:`TextIOWrapper.tell` and :meth:`TextIOWrapper.seek` are both
903903
quite slow due to the reconstruction algorithm used.
904904

905-
:class:`StringIO`, however, is a native in-memory unicode container and will
905+
:class:`~io.StringIO`, however, is a native in-memory unicode container and will
906906
exhibit similar speed to :class:`BytesIO`.
907907

908908
Multi-threading

0 commit comments

Comments
 (0)