cpython: 5b40d81e8883 (original) (raw)

Mercurial > cpython

changeset 105418:5b40d81e8883 2.7

Issue #21818: Fixed references to classes that have names matching with module names. [#21818]

Serhiy Storchaka storchaka@gmail.com
date Fri, 02 Dec 2016 23:13:42 +0200
parents ea904d4b3634
children dc7c86de9e13
files Doc/library/array.rst Doc/library/configparser.rst Doc/library/cookie.rst Doc/library/cookielib.rst Doc/library/datetime.rst Doc/library/docxmlrpcserver.rst Doc/library/dumbdbm.rst Doc/library/formatter.rst Doc/library/gzip.rst Doc/library/htmllib.rst Doc/library/io.rst Doc/library/mimewriter.rst Doc/library/mmap.rst Doc/library/mutex.rst Doc/library/netrc.rst Doc/library/queue.rst Doc/library/scrolledtext.rst Doc/library/simplexmlrpcserver.rst Doc/library/socket.rst Doc/library/stringio.rst Doc/library/userdict.rst Doc/whatsnew/2.1.rst Doc/whatsnew/2.2.rst Doc/whatsnew/2.3.rst Doc/whatsnew/2.4.rst Doc/whatsnew/2.5.rst Doc/whatsnew/2.6.rst
diffstat 27 files changed, 124 insertions(+), 124 deletions(-)[+] [-] Doc/library/array.rst 4 Doc/library/configparser.rst 20 Doc/library/cookie.rst 10 Doc/library/cookielib.rst 20 Doc/library/datetime.rst 4 Doc/library/docxmlrpcserver.rst 6 Doc/library/dumbdbm.rst 2 Doc/library/formatter.rst 2 Doc/library/gzip.rst 2 Doc/library/htmllib.rst 12 Doc/library/io.rst 12 Doc/library/mimewriter.rst 10 Doc/library/mmap.rst 6 Doc/library/mutex.rst 2 Doc/library/netrc.rst 10 Doc/library/queue.rst 8 Doc/library/scrolledtext.rst 4 Doc/library/simplexmlrpcserver.rst 8 Doc/library/socket.rst 2 Doc/library/stringio.rst 14 Doc/library/userdict.rst 48 Doc/whatsnew/2.1.rst 2 Doc/whatsnew/2.2.rst 2 Doc/whatsnew/2.3.rst 12 Doc/whatsnew/2.4.rst 2 Doc/whatsnew/2.5.rst 6 Doc/whatsnew/2.6.rst 18

line wrap: on

line diff

--- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -75,7 +75,7 @@ The module defines the following type: .. data:: ArrayType

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

--- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -21,7 +21,7 @@ single: ini file single: Windows ini file -This module defines the class :class:ConfigParser. The :class:ConfigParser +This module defines the class :class:~ConfigParser.ConfigParser. The :class:~ConfigParser.ConfigParser class implements a basic configuration file parser language which provides a structure similar to what you would find on Microsoft Windows INI files. You can use this to write Python programs which can be customized by end users @@ -74,12 +74,12 @@ For example:: would resolve the %(dir)s to the value of dir (frob in this case). All reference expansions are done on demand. -Default values can be specified by passing them into the :class:ConfigParser +Default values can be specified by passing them into the :class:~ConfigParser.ConfigParser constructor as a dictionary. Additional defaults may be passed into the :meth:get method which will override all others. Sections are normally stored in a built-in dictionary. An alternative dictionary -type can be passed to the :class:ConfigParser constructor. For example, if a +type can be passed to the :class:~ConfigParser.ConfigParser constructor. For example, if a dictionary type is passed that sorts its keys, the sections will be sorted on write-back, as will be the keys within each section. @@ -135,7 +135,7 @@ write-back, as will be the keys within e .. class:: SafeConfigParser([defaults[, dict_type[, allow_no_value]]])

.. seealso:: @@ -279,7 +279,7 @@ RawConfigParser Objects list of potential configuration file locations (for example, the current directory, the user's home directory, and some system-wide directory), and all existing configuration files in the list will be read. If none of the named

@@ -394,7 +394,7 @@ RawConfigParser Objects ConfigParser Objects -------------------- -The :class:ConfigParser class extends some methods of the +The :class:~ConfigParser.ConfigParser class extends some methods of the :class:RawConfigParser interface, adding some optional arguments. @@ -422,7 +422,7 @@ SafeConfigParser Objects ------------------------ The :class:SafeConfigParser class implements the same extended interface as -:class:ConfigParser, with the following addition: +:class:~ConfigParser.ConfigParser, with the following addition: .. method:: SafeConfigParser.set(section, option, value) @@ -480,7 +480,7 @@ An example of reading the configuration if config.getboolean('Section1', 'a_bool'): print config.get('Section1', 'foo') -To get interpolation, you will need to use a :class:ConfigParser or +To get interpolation, you will need to use a :class:~ConfigParser.ConfigParser or :class:SafeConfigParser:: import ConfigParser

--- a/Doc/library/cookie.rst +++ b/Doc/library/cookie.rst @@ -82,11 +82,11 @@ in Cookie name (as :attr:~Morsel.key). The same security warning from :class:SerialCookie applies here. A further security note is warranted. For backwards compatibility, the -:mod:Cookie module exports a class named :class:Cookie which is just an -alias for :class:SmartCookie. This is probably a mistake and will likely be -removed in a future version. You should not use the :class:Cookie class in -your applications, for the same reason why you should not use the -:class:SerialCookie class. +:mod:Cookie module exports a class named :class:~Cookie.Cookie which is +just an alias for :class:SmartCookie. This is probably a mistake and will +likely be removed in a future version. You should not use the +:class:~Cookie.Cookie class in your applications, for the same reason why +you should not use the :class:SerialCookie class. .. seealso::

--- a/Doc/library/cookielib.rst +++ b/Doc/library/cookielib.rst @@ -100,7 +100,7 @@ The following classes are provided: 1) are treated according to the RFC 2965 rules. However, if RFC 2965 handling is turned off or :attr:rfc2109_as_netscape is True, RFC 2109 cookies are 'downgraded' by the :class:CookieJar instance to Netscape cookies, by

@@ -108,7 +108,7 @@ The following classes are provided: .. class:: Cookie() This class represents Netscape, RFC 2109 and RFC 2965 cookies. It is not

@@ -146,7 +146,7 @@ CookieJar and FileCookieJar Objects ----------------------------------- :class:CookieJar objects support the :term:iterator protocol for iterating over -contained :class:Cookie objects. +contained :class:~cookielib.Cookie objects. :class:CookieJar has the following methods: @@ -194,7 +194,7 @@ contained :class:Cookie objects. .. method:: CookieJar.make_cookies(response, request)

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

.. method:: CookieJar.set_cookie(cookie)

@@ -383,7 +383,7 @@ methods: :meth:path_return_ok is called for the cookie path. Otherwise, :meth:path_return_ok and :meth:return_ok are never called for that cookie domain. If :meth:path_return_ok returns true, :meth:return_ok is called

@@ -608,7 +608,7 @@ combinations of the above flags: Cookie Objects -------------- -:class:Cookie instances have Python attributes roughly corresponding to the +:class:~cookielib.Cookie instances have Python attributes roughly corresponding to the standard cookie-attributes specified in the various cookie standards. The correspondence is not one-to-one, because there are complicated rules for assigning default values, because the max-age and expires @@ -724,7 +724,7 @@ accessed using the following methods: Set the value of the named cookie-attribute. -The :class:Cookie class also defines the following method: +The :class:~cookielib.Cookie class also defines the following method: .. method:: Cookie.is_expired([now=None])

--- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1170,8 +1170,8 @@ Using datetime with tzinfo: .. _datetime-time: -:class:time Objects ---------------------- +:class:.time Objects +---------------------- A time object represents a (local) time of day, independent of any particular day, and subject to adjustment via a :class:tzinfo object.

--- a/Doc/library/docxmlrpcserver.rst +++ b/Doc/library/docxmlrpcserver.rst @@ -16,7 +16,7 @@ The :mod:DocXMLRPCServer module extends the classes found in :mod:SimpleXMLRPCServer to serve HTML documentation in response to HTTP GET -requests. Servers can either be free standing, using :class:DocXMLRPCServer, +requests. Servers can either be free standing, using :class:~DocXMLRPCServer.DocXMLRPCServer, or embedded in a CGI environment, using :class:DocCGIXMLRPCRequestHandler. @@ -36,7 +36,7 @@ or embedded in a CGI environment, using Create a new request handler instance. This request handler supports XML-RPC POST requests, documentation GET requests, and modifies logging so that the

@@ -45,7 +45,7 @@ or embedded in a CGI environment, using DocXMLRPCServer Objects ----------------------- -The :class:DocXMLRPCServer class is derived from +The :class:~DocXMLRPCServer.DocXMLRPCServer class is derived from :class:SimpleXMLRPCServer.SimpleXMLRPCServer and provides a means of creating self-documenting, stand alone XML-RPC servers. HTTP POST requests are handled as XML-RPC method calls. HTTP GET requests are handled by generating pydoc-style

--- a/Doc/library/dumbdbm.rst +++ b/Doc/library/dumbdbm.rst @@ -82,7 +82,7 @@ Dumbdbm Objects --------------- In addition to the methods provided by the :class:UserDict.DictMixin class, -:class:dumbdbm objects provide the following methods. +:class:~dumbdbm.dumbdbm objects provide the following methods. .. method:: dumbdbm.sync()

--- a/Doc/library/formatter.rst +++ b/Doc/library/formatter.rst @@ -9,7 +9,7 @@ .. index:: single: HTMLParser (class in htmllib) This module supports two interface definitions, each with multiple -implementations. The formatter interface is used by the :class:HTMLParser +implementations. The formatter interface is used by the :class:~HTMLParser.HTMLParser class of the :mod:htmllib module, and the writer interface is required by the formatter interface.

--- a/Doc/library/gzip.rst +++ b/Doc/library/gzip.rst @@ -67,7 +67,7 @@ The module defines the following items: fileobj, since you might wish to append more material after the compressed data. This also allows you to pass a :class:~StringIO.StringIO object opened for writing as fileobj, and retrieve the resulting memory buffer using the

--- a/Doc/library/htmllib.rst +++ b/Doc/library/htmllib.rst @@ -24,11 +24,11 @@ This module defines a class which can se formatted in the HyperText Mark-up Language (HTML). The class is not directly concerned with I/O --- it must be provided with input in string form via a method, and makes calls to methods of a "formatter" object in order to produce -output. The :class:HTMLParser class is designed to be used as a base class +output. The :class:~HTMLParser.HTMLParser class is designed to be used as a base class for other classes in order to add functionality, and allows most of its methods to be extended or overridden. In turn, this class is derived from and extends the :class:SGMLParser class defined in module :mod:sgmllib. The -:class:HTMLParser implementation supports the HTML 2.0 language as described +:class:~HTMLParser.HTMLParser implementation supports the HTML 2.0 language as described in :rfc:1866. Two implementations of formatter objects are provided in the :mod:formatter module; refer to the documentation for that module for information on the formatter interface. @@ -70,7 +70,7 @@ The module defines a parser class and an .. exception:: HTMLParseError

.. _html-parser-objects: @@ -99,7 +99,7 @@ The module defines a parser class and an HTMLParser Objects ------------------ -In addition to tag methods, the :class:HTMLParser class provides some +In addition to tag methods, the :class:~HTMLParser.HTMLParser class provides some additional methods and instance variables for use within tag methods. @@ -173,7 +173,7 @@ additional methods and instance variable This module defines three dictionaries, name2codepoint, codepoint2name, and entitydefs. entitydefs is used by the :mod:htmllib module to -provide the :attr:entitydefs attribute of the :class:HTMLParser class. The +provide the :attr:entitydefs attribute of the :class:~HTMLParser.HTMLParser class. The definition provided here contains all the entities defined by XHTML 1.0 that can be handled using simple textual substitution in the Latin-1 character set (ISO-8859-1).

--- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -47,7 +47,7 @@ Another :class:IOBase subclass, :class streams whose bytes represent text, and handles encoding and decoding from and to :class:unicode strings. :class:TextIOWrapper, which extends it, is a buffered text interface to a buffered raw stream -(:class:BufferedIOBase). Finally, :class:StringIO is an in-memory +(:class:BufferedIOBase). Finally, :class:~io.StringIO is an in-memory stream for unicode text. Argument names are not part of the specification, and only the arguments of @@ -180,7 +180,7 @@ Module Interface It is also possible to use an :class:unicode or :class:bytes string as a file for both reading and writing. For :class:unicode strings

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

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

@@ -902,7 +902,7 @@ if you handle huge amounts of text data Also, :meth:TextIOWrapper.tell and :meth:TextIOWrapper.seek are both quite slow due to the reconstruction algorithm used. -:class:StringIO, however, is a native in-memory unicode container and will +:class:~io.StringIO, however, is a native in-memory unicode container and will exhibit similar speed to :class:BytesIO. Multi-threading

--- a/Doc/library/mimewriter.rst +++ b/Doc/library/mimewriter.rst @@ -12,17 +12,17 @@ The :mod:email package should be used in preference to the :mod:MimeWriter module. This module is present only to maintain backward compatibility. -This module defines the class :class:MimeWriter. The :class:MimeWriter +This module defines the class :class:~MimeWriter.MimeWriter. The :class:~MimeWriter.MimeWriter class implements a basic formatter for creating MIME multi-part files. It doesn't seek around the output file nor does it use large amounts of buffer space. You must write the parts out in the order that they should occur in the -final file. :class:MimeWriter does buffer the headers you add, allowing you +final file. :class:~MimeWriter.MimeWriter does buffer the headers you add, allowing you to rearrange their order. .. class:: MimeWriter(fp)

@@ -32,7 +32,7 @@ to rearrange their order. MimeWriter Objects ------------------ -:class:MimeWriter instances have the following methods: +:class:~MimeWriter.MimeWriter instances have the following methods: .. method:: MimeWriter.addheader(key, value[, prefix]) @@ -72,7 +72,7 @@ MimeWriter Objects .. method:: MimeWriter.nextpart()

--- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -15,7 +15,7 @@ change a substring by assigning to a sli also read and write data starting at the current file position, and :meth:seek through the file to different positions. -A memory-mapped file is created by the :class:mmap constructor, which is +A memory-mapped file is created by the :class:~mmap.mmap constructor, which is different on Unix and on Windows. In either case you must provide a file descriptor for a file opened for update. If you wish to map an existing Python file object, use its :meth:fileno method to obtain the correct value for the @@ -77,7 +77,7 @@ memory but does not update the underlyin (Unix version) Maps length bytes from the file specified by the file descriptor fileno, and returns a mmap object. If length is 0, the maximum length of the map will be the current size of the file when

--- a/Doc/library/mutex.rst +++ b/Doc/library/mutex.rst @@ -40,7 +40,7 @@ The :mod:mutex module defines the foll Mutex Objects ------------- -:class:mutex objects have following methods: +:class:~mutex.mutex objects have following methods: .. method:: mutex.test()

--- a/Doc/library/netrc.rst +++ b/Doc/library/netrc.rst @@ -14,13 +14,13 @@ -------------- -The :class:netrc class parses and encapsulates the netrc file format used by +The :class:~netrc.netrc class parses and encapsulates the netrc file format used by the Unix :program:ftp program and other FTP clients. .. class:: netrc([file])

.. exception:: NetrcParseError

-A :class:netrc instance has the following methods: +A :class:~netrc.netrc instance has the following methods: .. method:: netrc.authenticators(host) @@ -65,7 +65,7 @@ A :class:netrc instance has the follow Dump the class data as a string in the format of a netrc file. (This discards comments and may reorder the entries.) -Instances of :class:netrc have public instance variables: +Instances of :class:~netrc.netrc have public instance variables: .. attribute:: netrc.hosts

--- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -15,7 +15,7 @@ The :mod:Queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be -exchanged safely between multiple threads. The :class:Queue class in this +exchanged safely between multiple threads. The :class:~Queue.Queue class in this module implements all the required locking semantics. It depends on the availability of thread support in Python; see the :mod:threading module. @@ -62,14 +62,14 @@ The :mod:Queue module defines the foll Exception raised when non-blocking :meth:~Queue.get (or :meth:~Queue.get_nowait) is called

.. exception:: Full Exception raised when non-blocking :meth:~Queue.put (or :meth:~Queue.put_nowait) is called

.. seealso:: @@ -83,7 +83,7 @@ The :mod:Queue module defines the foll Queue Objects ------------- -Queue objects (:class:Queue, :class:LifoQueue, or :class:PriorityQueue) +Queue objects (:class:~Queue.Queue, :class:LifoQueue, or :class:PriorityQueue) provide the public methods described below.

--- a/Doc/library/scrolledtext.rst +++ b/Doc/library/scrolledtext.rst @@ -9,7 +9,7 @@ The :mod:ScrolledText module provides a class of the same name which implements a basic text widget which has a vertical scroll bar configured to do -the "right thing." Using the :class:ScrolledText class is a lot easier than +the "right thing." Using the :class:~ScrolledText.ScrolledText class is a lot easier than setting up a text widget and scroll bar directly. The constructor is the same as that of the :class:Tkinter.Text class. @@ -21,7 +21,7 @@ as that of the :class:Tkinter.Text cla The text widget and scrollbar are packed together in a :class:Frame, and the methods of the :class:Grid and :class:Pack geometry managers are acquired -from the :class:Frame object. This allows the :class:ScrolledText widget to +from the :class:Frame object. This allows the :class:~ScrolledText.ScrolledText widget to be used directly to achieve most normal geometry management behavior. Should more specific control be necessary, the following attributes are

--- a/Doc/library/simplexmlrpcserver.rst +++ b/Doc/library/simplexmlrpcserver.rst @@ -20,7 +20,7 @@ The :mod:SimpleXMLRPCServer module provides a basic server framework for XML-RPC servers written in Python. Servers can either be free standing, using -:class:SimpleXMLRPCServer, or embedded in a CGI environment, using +:class:~SimpleXMLRPCServer.SimpleXMLRPCServer, or embedded in a CGI environment, using :class:CGIXMLRPCRequestHandler. @@ -62,7 +62,7 @@ XML-RPC servers written in Python. Serv Create a new request handler instance. This request handler supports POST requests and modifies logging so that the logRequests parameter to the

.. _simple-xmlrpc-servers: @@ -70,7 +70,7 @@ XML-RPC servers written in Python. Serv SimpleXMLRPCServer Objects -------------------------- -The :class:SimpleXMLRPCServer class is based on +The :class:~SimpleXMLRPCServer.SimpleXMLRPCServer class is based on :class:SocketServer.TCPServer and provides a means of creating simple, stand alone XML-RPC servers. @@ -197,7 +197,7 @@ server:: # Print list of available methods print s.system.listMethods() -The following :class:SimpleXMLRPCServer example is included in the module +The following :class:~SimpleXMLRPCServer.SimpleXMLRPCServer example is included in the module Lib/SimpleXMLRPCServer.py:: server = SimpleXMLRPCServer(("localhost", 8000))

--- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -835,7 +835,7 @@ Note that there are no methods :meth:re[](#l19.3) :meth:socket.recv and :meth:socket.send without *flags* argument instead.[](#l19.4) [](#l19.5) Socket objects also have these (read-only) attributes that correspond to the[](#l19.6) -values given to the :class:socket constructor.[](#l19.7) +values given to the :class:~socket.socket` constructor. .. attribute:: socket.family

--- a/Doc/library/stringio.rst +++ b/Doc/library/stringio.rst @@ -6,7 +6,7 @@ :synopsis: Read and write strings as if they were files. -This module implements a file-like class, :class:StringIO, that reads and +This module implements a file-like class, :class:~StringIO.StringIO, that reads and writes a string buffer (also known as memory files). See the description of file objects for operations (section :ref:bltin-file-objects). (For standard strings, see :class:str and :class:unicode.) @@ -14,23 +14,23 @@ standard strings, see :class:str and : .. class:: StringIO([buffer])

-The following methods of :class:StringIO objects require special mention: +The following methods of :class:~StringIO.StringIO objects require special mention: .. method:: StringIO.getvalue() Retrieve the entire contents of the "file" at any time before the

@@ -38,7 +38,7 @@ The following methods of :class:`StringI .. method:: StringIO.close() Free the memory buffer. Attempting to do further operations with a closed

Example usage::

--- a/Doc/library/userdict.rst +++ b/Doc/library/userdict.rst @@ -14,15 +14,15 @@ for classes that already have a minimum simplifies writing classes that need to be substitutable for dictionaries (such as the shelve module). -This module also defines a class, :class:UserDict, that acts as a wrapper +This module also defines a class, :class:~UserDict.UserDict, that acts as a wrapper around dictionary objects. The need for this class has been largely supplanted by the ability to subclass directly from :class:dict (a feature that became available starting with Python version 2.2). Prior to the introduction of -:class:dict, the :class:UserDict class was used to create dictionary-like +:class:dict, the :class:~UserDict.UserDict class was used to create dictionary-like sub-classes that obtained new behaviors by overriding existing methods or adding new ones. -The :mod:UserDict module defines the :class:UserDict class and +The :mod:UserDict module defines the :class:~UserDict.UserDict class and :class:DictMixin: @@ -30,28 +30,28 @@ The :mod:UserDict module defines the : Class that simulates a dictionary. The instance's contents are kept in a regular dictionary, which is accessible via the :attr:data attribute of

.. class:: IterableUserDict([initialdata])

In addition to supporting the methods and operations of mappings (see section -:ref:typesmapping), :class:UserDict and :class:IterableUserDict instances +:ref:typesmapping), :class:~UserDict.UserDict and :class:IterableUserDict instances provide the following attribute: .. attribute:: IterableUserDict.data

.. class:: DictMixin() @@ -96,7 +96,7 @@ provide the following attribute: In addition, this class can be mixed-in with built-in classes using multiple inheritance. This can sometimes be useful. For example, you can inherit

This module defines a class that acts as a wrapper around list objects. It is a @@ -104,34 +104,34 @@ useful base class for your own list-like and override existing methods or add new ones. In this way one can add new behaviors to lists. -The :mod:UserList module defines the :class:UserList class: +The :mod:UserList module defines the :class:~UserList.UserList class: .. class:: UserList([list]) Class that simulates a list. The instance's contents are kept in a regular

In addition to supporting the methods and operations of mutable sequences (see -section :ref:typesseq), :class:UserList instances provide the following +section :ref:typesseq), :class:~UserList.UserList instances provide the following attribute: .. attribute:: UserList.data

-Subclassing requirements: Subclasses of :class:UserList are expected to +Subclassing requirements: Subclasses of :class:~UserList.UserList are expected to offer a constructor which can be called with either no arguments or one argument. List operations which return a new sequence attempt to create an instance of the actual implementation class. To do so, it assumes that the @@ -160,10 +160,10 @@ in that case. .. note::

This module defines a class that acts as a wrapper around string objects. It is @@ -182,14 +182,14 @@ The :mod:UserString module defines the Class that simulates a string or a Unicode string object. The instance's content is kept in a regular string or Unicode string object, which is

@@ -197,7 +197,7 @@ The :mod:UserString module defines the .. class:: MutableString([sequence])

In addition to supporting the methods and operations of string and Unicode -objects (see section :ref:string-methods), :class:UserString instances +objects (see section :ref:string-methods), :class:~UserString.UserString instances provide the following attribute: .. attribute:: MutableString.data A real Python string or Unicode object used to store the content of the

--- a/Doc/whatsnew/2.1.rst +++ b/Doc/whatsnew/2.1.rst @@ -445,7 +445,7 @@ The dictionary containing attributes can :attr:~object.__dict__. Unlike the :attr:~object.__dict__ attribute of class instances, in functions you can actually assign a new dictionary to :attr:~object.__dict__, though the new value is restricted to a regular Python dictionary; you can't be -tricky and set it to a :class:UserDict instance, or any other random object +tricky and set it to a :class:~UserDict.UserDict instance, or any other random object that behaves like a mapping.

--- a/Doc/whatsnew/2.2.rst +++ b/Doc/whatsnew/2.2.rst @@ -55,7 +55,7 @@ implemented in C. In particular, it's n so you can't just subclass, say, lists in order to add a single useful method to them. The :mod:UserList module provides a class that supports all of the methods of lists and that can be subclassed further, but there's lots of C code -that expects a regular Python list and won't accept a :class:UserList +that expects a regular Python list and won't accept a :class:~UserList.UserList instance. Python 2.2 fixes this, and in the process adds some exciting new capabilities.

--- a/Doc/whatsnew/2.3.rst +++ b/Doc/whatsnew/2.3.rst @@ -1683,13 +1683,13 @@ Date and time types suitable for express fancy features, and just stick to the basics of representing time. The three primary types are: :class:date, representing a day, month, and year; -:class:time, consisting of hour, minute, and second; and :class:datetime, -which contains all the attributes of both :class:date and :class:time. +:class:~datetime.time, consisting of hour, minute, and second; and :class:~datetime.datetime, +which contains all the attributes of both :class:date and :class:~datetime.time. There's also a :class:timedelta class representing differences between two points in time, and time zone logic is implemented by classes inheriting from the abstract :class:tzinfo class. -You can create instances of :class:date and :class:time by either supplying +You can create instances of :class:date and :class:~datetime.time by either supplying keyword arguments to the appropriate constructor, e.g. datetime.date(year=1972, month=10, day=15), or by using one of a number of class methods. For example, the :meth:date.today class method returns the @@ -1708,7 +1708,7 @@ number of methods for producing formatte '2002 30 Dec' The :meth:replace method allows modifying one or more fields of a -:class:date or :class:datetime instance, returning a new instance:: +:class:date or :class:~datetime.datetime instance, returning a new instance:: >>> d = datetime.datetime.now() >>> d @@ -1718,11 +1718,11 @@ The :meth:replace method allows modify >>> Instances can be compared, hashed, and converted to strings (the result is the -same as that of :meth:isoformat). :class:date and :class:datetime +same as that of :meth:isoformat). :class:date and :class:~datetime.datetime instances can be subtracted from each other, and added to :class:timedelta instances. The largest missing feature is that there's no standard library support for parsing strings and getting back a :class:date or -:class:datetime. +:class:~datetime.datetime. For more information, refer to the module's reference documentation. (Contributed by Tim Peters.)

--- a/Doc/whatsnew/2.4.rst +++ b/Doc/whatsnew/2.4.rst @@ -1523,7 +1523,7 @@ code: empty list instead of raising a :exc:TypeError exception if called with no arguments. -* You can no longer compare the :class:date and :class:datetime instances +* You can no longer compare the :class:date and :class:~datetime.datetime instances provided by the :mod:datetime module. Two instances of different classes will now always be unequal, and relative comparisons (<, >) will raise a :exc:TypeError.

--- a/Doc/whatsnew/2.5.rst +++ b/Doc/whatsnew/2.5.rst @@ -1307,7 +1307,7 @@ complete list of changes, or look throug (Contributed by Skip Montanaro and Andrew McNamara.) -* The :class:datetime class in the :mod:datetime module now has a +* The :class:~datetime.datetime class in the :mod:datetime module now has a :meth:strptime(string, format) method for parsing date strings, contributed by Josh Spoerri. It uses the same format characters as :func:time.strptime and :func:time.strftime:: @@ -1497,7 +1497,7 @@ complete list of changes, or look throug

--- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -609,10 +609,10 @@ multiple of 4. result = queue.get() print 'Factorial', N, '=', result -A :class:Queue is used to communicate the result of the factorial. -The :class:Queue object is stored in a global variable. +A :class:~Queue.Queue is used to communicate the result of the factorial. +The :class:~Queue.Queue object is stored in a global variable. The child process will use the value of the variable when the child -was created; because it's a :class:Queue, parent and child can use +was created; because it's a :class:~Queue.Queue, parent and child can use the object to communicate. (If the parent were to change the value of the global variable, the child's value would be unaffected, and vice versa.) @@ -1077,7 +1077,7 @@ the :mod:io module: There are two concrete implementations. :class:TextIOWrapper wraps a buffered I/O object, supporting all of the methods for text I/O and adding a :attr:buffer attribute for access