cpython: c642c597d05c (original) (raw)

Mercurial > cpython

changeset 105421:c642c597d05c

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:15:42 +0200
parents dd4c420b8e66(current diff)62c9a89a2103(diff)
children 014f52fe1da1
files Doc/library/socket.rst
diffstat 9 files changed, 30 insertions(+), 30 deletions(-)[+] [-] Doc/library/array.rst 2 Doc/library/datetime.rst 6 Doc/library/mmap.rst 8 Doc/library/netrc.rst 10 Doc/library/socket.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 12

line wrap: on

line diff

--- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -254,7 +254,7 @@ When an array object is printed or conve empty, otherwise it is a string if the typecode is 'u', 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/datetime.rst +++ b/Doc/library/datetime.rst @@ -1368,8 +1368,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. @@ -1466,7 +1466,7 @@ Supported operations: !=. The latter cases return :const:False or :const:True, respectively. .. versionchanged:: 3.3

--- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -14,7 +14,7 @@ byte by doing obj[index] = 97, or ch slice: obj[i1:i2] = b'...'. You can 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 @@ -70,7 +70,7 @@ To map anonymous memory, -1 should be pa (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

@@ -122,7 +122,7 @@ To map anonymous memory, -1 should be pa mm.close()

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

--- 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 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 @@ -613,10 +613,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.) @@ -2131,7 +2131,7 @@ changes, or look through the Subversion (Contributed by Christian Heimes and Mark Dickinson.) -* :class:mmap objects now have a :meth:rfind method that searches for a +* :class:~mmap.mmap objects now have a :meth:rfind method that searches for a substring beginning at the end of the string and searching backwards. The :meth:find method also gained an end parameter giving an index at which to stop searching. @@ -2630,7 +2630,7 @@ changes, or look through the Subversion :class:datetime.date and :class:datetime.time to the :class:xmlrpclib.DateTime type; the conversion semantics were not necessarily correct for all applications. Code using