diff options
Diffstat (limited to 'Doc/library')
35 files changed, 78 insertions, 234 deletions
diff --git a/Doc/library/base64.rst b/Doc/library/base64.rst index 68a941f..35b61ae 100644 --- a/Doc/library/base64.rst +++ b/Doc/library/base64.rst @@ -21,8 +21,7 @@ encoding and decoding string objects using all three alphabets. The legacy interface provides for encoding and decoding to and from file-like objects as well as strings, but only using the Base64 standard alphabet. -The modern interface, which was introduced in Python 2.4, provides: - +The modern interface provides: .. function:: b64encode(s[, altchars]) diff --git a/Doc/library/codeop.rst b/Doc/library/codeop.rst index 456f6dd..97b6267 100644 --- a/Doc/library/codeop.rst +++ b/Doc/library/codeop.rst @@ -66,28 +66,3 @@ To do just the former: :func:`compile_command`; the difference is that if the instance compiles program text containing a ``__future__`` statement, the instance 'remembers' and compiles all subsequent program texts with the statement in force. - -A note on version compatibility: the :class:`Compile` and -:class:`CommandCompiler` are new in Python 2.2. If you want to enable the -future-tracking features of 2.2 but also retain compatibility with 2.1 and -earlier versions of Python you can either write :: - - try: - from codeop import CommandCompiler - compile_command = CommandCompiler() - del CommandCompiler - except ImportError: - from codeop import compile_command - -which is a low-impact change, but introduces possibly unwanted global state into -your program, or you can write:: - - try: - from codeop import CommandCompiler - except ImportError: - def CommandCompiler(): - from codeop import compile_command - return compile_command - -and then call ``CommandCompiler`` every time you need a fresh compiler object. - diff --git a/Doc/library/cookielib.rst b/Doc/library/cookielib.rst index f6008f1..c8e7298 100644 --- a/Doc/library/cookielib.rst +++ b/Doc/library/cookielib.rst @@ -38,12 +38,7 @@ The module defines the following exception: .. exception:: LoadError Instances of :class:`FileCookieJar` raise this exception on failure to load - cookies from a file. - - .. note:: - - For backwards-compatibility with Python 2.4 (which raised an :exc:`IOError`), - :exc:`LoadError` is a subclass of :exc:`IOError`. + cookies from a file. :exc:`LoadError` is a subclass of :exc:`IOError`. The following classes are provided: @@ -266,11 +261,6 @@ contained :class:`Cookie` objects. :exc:`LoadError` will be raised. Also, :exc:`IOError` may be raised, for example if the file does not exist. - .. note:: - - For backwards-compatibility with Python 2.4 (which raised an :exc:`IOError`), - :exc:`LoadError` is a subclass of :exc:`IOError`. - .. method:: FileCookieJar.revert(filename=None, ignore_discard=False, ignore_expires=False) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 6968f42..5efa548 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1957,7 +1957,6 @@ Data types is zero. If the source buffer is not large enough a ValueError is raised. - .. versionadded:: 2.6 .. method:: _CData.from_buffer_copy(source[, offset]) @@ -1967,8 +1966,6 @@ Data types in bytes; the default is zero. If the source buffer is not large enough a ValueError is raised. - .. versionadded:: 2.6 - .. method:: from_address(address) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index b7dd32f..7052c7b 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -766,9 +766,8 @@ Each thread has its own current context which is accessed or changed using the Set the current context for the active thread to *c*. -Beginning with Python 2.5, you can also use the :keyword:`with` statement and -the :func:`localcontext` function to temporarily change the active context. - +You can also use the :keyword:`with` statement and the :func:`localcontext` +function to temporarily change the active context. .. function:: localcontext([c]) diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index 01c9c85..00f273e 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -201,14 +201,13 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. Optional keyword parameters *linejunk* and *charjunk* are for filter functions (or ``None``): - *linejunk*: A function that accepts a single string argument, and returns true - if the string is junk, or false if not. The default is (``None``), starting with - Python 2.3. Before then, the default was the module-level function - :func:`IS_LINE_JUNK`, which filters out lines without visible characters, except - for at most one pound character (``'#'``). As of Python 2.3, the underlying - :class:`SequenceMatcher` class does a dynamic analysis of which lines are so - frequent as to constitute noise, and this usually works better than the pre-2.3 - default. + *linejunk*: A function that accepts a single string argument, and returns + true if the string is junk, or false if not. The default is ``None``. There + is also a module-level function :func:`IS_LINE_JUNK`, which filters out lines + without visible characters, except for at most one pound character (``'#'``) + -- however the underlying :class:`SequenceMatcher` class does a dynamic + analysis of which lines are so frequent as to constitute noise, and this + usually works better than using this function. *charjunk*: A function that accepts a character (a string of length 1), and returns if the character is junk, or false if not. The default is module-level @@ -302,7 +301,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. Return true for ignorable lines. The line *line* is ignorable if *line* is blank or contains a single ``'#'``, otherwise it is not ignorable. Used as a - default for parameter *linejunk* in :func:`ndiff` before Python 2.3. + default for parameter *linejunk* in :func:`ndiff` in older versions. .. function:: IS_CHARACTER_JUNK(ch) diff --git a/Doc/library/fcntl.rst b/Doc/library/fcntl.rst index 7244e7b..0e69407 100644 --- a/Doc/library/fcntl.rst +++ b/Doc/library/fcntl.rst @@ -65,7 +65,7 @@ The module defines the following functions: so long as the buffer you pass is as least as long as what the operating system wants to put there, things should work. - If *mutate_flag* is true, then the buffer is (in effect) passed to the + If *mutate_flag* is true (the default), then the buffer is (in effect) passed to the underlying :func:`ioctl` system call, the latter's return code is passed back to the calling Python, and the buffer's new contents reflect the action of the :func:`ioctl`. This is a slight simplification, because if the supplied buffer @@ -73,10 +73,6 @@ The module defines the following functions: long which is then passed to :func:`ioctl` and copied back into the supplied buffer. - If *mutate_flag* is not supplied, then from Python 2.5 it defaults to true, - which is a change from versions 2.3 and 2.4. Supply the argument explicitly if - version portability is a priority. - An example:: >>> import array, fcntl, struct, termios, os diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst index 4ce8893..41bdcd8 100644 --- a/Doc/library/ftplib.rst +++ b/Doc/library/ftplib.rst @@ -187,9 +187,8 @@ followed by ``lines`` for the text version or ``binary`` for the binary version. .. method:: FTP.set_pasv(boolean) - Enable "passive" mode if *boolean* is true, other disable passive mode. (In - Python 2.0 and before, passive mode was off by default; in Python 2.1 and later, - it is on by default.) + Enable "passive" mode if *boolean* is true, other disable passive mode. + Passive mode is on by default. .. method:: FTP.storbinary(command, file[, blocksize, callback]) diff --git a/Doc/library/getpass.rst b/Doc/library/getpass.rst index 91c811b..ff1c091 100644 --- a/Doc/library/getpass.rst +++ b/Doc/library/getpass.rst @@ -12,11 +12,11 @@ The :mod:`getpass` module provides two functions: .. function:: getpass([prompt[, stream]]) - Prompt the user for a password without echoing. The user is prompted using the - string *prompt*, which defaults to ``'Password: '``. On Unix, the prompt is - written to the file-like object *stream*. *stream* defaults to the - controlling terminal (/dev/tty) or if that is unavailable to ``sys.stderr`` - (this argument is ignored on Windows). + Prompt the user for a password without echoing. The user is prompted using + the string *prompt*, which defaults to ``'Password: '``. On Unix, the prompt + is written to the file-like object *stream*. *stream* defaults to the + controlling terminal (:file:`/dev/tty`) or if that is unavailable to + ``sys.stderr`` (this argument is ignored on Windows). If echo free input is unavailable getpass() falls back to printing a warning message to *stream* and reading from ``sys.stdin`` and @@ -24,9 +24,6 @@ The :mod:`getpass` module provides two functions: Availability: Macintosh, Unix, Windows. - .. versionchanged:: 2.6 - On Unix it defaults to using /dev/tty before falling back - to ``sys.stdin`` and ``sys.stderr``. .. note:: If you call getpass from within IDLE, the input may be done in the terminal you launched IDLE from rather than the idle window itself. diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index d622e1d..7ef5d3f 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -273,10 +273,10 @@ attributes: Return true if the object is a method descriptor, but not if :func:`ismethod` or :func:`isclass` or :func:`isfunction` are true. - This is new as of Python 2.2, and, for example, is true of - ``int.__add__``. An object passing this test has a :attr:`__get__` attribute - but not a :attr:`__set__` attribute, but beyond that the set of attributes - varies. :attr:`__name__` is usually sensible, and :attr:`__doc__` often is. + This, for example, is true of ``int.__add__``. An object passing this test + has a :attr:`__get__` attribute but not a :attr:`__set__` attribute, but + beyond that the set of attributes varies. :attr:`__name__` is usually + sensible, and :attr:`__doc__` often is. Methods implemented via descriptors that also pass one of the other tests return false from the :func:`ismethoddescriptor` test, simply because the diff --git a/Doc/library/json.rst b/Doc/library/json.rst index a0a62d1..79430c3 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -5,7 +5,6 @@ :synopsis: Encode and decode the JSON format. .. moduleauthor:: Bob Ippolito <bob@redivi.com> .. sectionauthor:: Bob Ippolito <bob@redivi.com> -.. versionadded:: 2.6 JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. diff --git a/Doc/library/macos.rst b/Doc/library/macos.rst index 543f868..0eb7225 100644 --- a/Doc/library/macos.rst +++ b/Doc/library/macos.rst @@ -16,9 +16,7 @@ Note the capitalization of the module name; this is a historical artifact. .. data:: runtimemodel - Always ``'macho'``, from Python 2.4 on. In earlier versions of Python the value - could also be ``'ppc'`` for the classic Mac OS 8 runtime model or ``'carbon'`` - for the Mac OS 9 runtime model. + Always ``'macho'``. .. data:: linkmodel diff --git a/Doc/library/markup.rst b/Doc/library/markup.rst index dd0dd8f..19ce7b9 100644 --- a/Doc/library/markup.rst +++ b/Doc/library/markup.rst @@ -11,11 +11,9 @@ Language (SGML) and the Hypertext Markup Language (HTML), and several interfaces for working with the Extensible Markup Language (XML). It is important to note that modules in the :mod:`xml` package require that -there be at least one SAX-compliant XML parser available. Starting with Python -2.3, the Expat parser is included with Python, so the :mod:`xml.parsers.expat` -module will always be available. You may still want to be aware of the `PyXML -add-on package <http://pyxml.sourceforge.net/>`_; that package provides an -extended set of XML libraries for Python. +there be at least one SAX-compliant XML parser available. The Expat parser is +included with Python, so the :mod:`xml.parsers.expat` module will always be +available. The documentation for the :mod:`xml.dom` and :mod:`xml.sax` packages are the definition of the Python bindings for the DOM and SAX interfaces. @@ -35,10 +33,3 @@ definition of the Python bindings for the DOM and SAX interfaces. xml.sax.utils.rst xml.sax.reader.rst xml.etree.elementtree.rst - -.. seealso:: - - `Python/XML Libraries <http://pyxml.sourceforge.net/>`_ - Home page for the PyXML package, containing an extension of :mod:`xml` package - bundled with Python. - diff --git a/Doc/library/marshal.rst b/Doc/library/marshal.rst index fbe3e45..8ef443f 100644 --- a/Doc/library/marshal.rst +++ b/Doc/library/marshal.rst @@ -100,10 +100,9 @@ In addition, the following constants are defined: .. data:: version - Indicates the format that the module uses. Version 0 is the historical format, - version 1 (added in Python 2.4) shares interned strings and version 2 (added in - Python 2.5) uses a binary format for floating point numbers. The current version - is 2. + Indicates the format that the module uses. Version 0 is the historical + format, version 1 shares interned strings and version 2 uses a binary format + for floating point numbers. The current version is 2. .. rubric:: Footnotes diff --git a/Doc/library/math.rst b/Doc/library/math.rst index d9593a8..b153f21 100644 --- a/Doc/library/math.rst +++ b/Doc/library/math.rst @@ -277,10 +277,6 @@ The module also defines two mathematical constants: platform and libm implementation. It's usually :exc:`ValueError` for *EDOM* and :exc:`OverflowError` for errno *ERANGE*. - ..versionchanged:: 2.6 - In earlier versions of Python the outcome of an operation with NaN as - input depended on platform and libm implementation. - .. seealso:: diff --git a/Doc/library/netrc.rst b/Doc/library/netrc.rst index e6cc648..91990df 100644 --- a/Doc/library/netrc.rst +++ b/Doc/library/netrc.rst @@ -66,9 +66,8 @@ Instances of :class:`netrc` have public instance variables: .. note:: - Passwords are limited to a subset of the ASCII character set. Versions of - this module prior to 2.3 were extremely limited. Starting with 2.3, all - ASCII punctuation is allowed in passwords. However, note that whitespace and + Passwords are limited to a subset of the ASCII character set. All ASCII + punctuation is allowed in passwords, however, note that whitespace and non-printable characters are not allowed in passwords. This is a limitation of the way the .netrc file is parsed and may be removed in the future. diff --git a/Doc/library/os.rst b/Doc/library/os.rst index bf0fe19..55e007a 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -463,8 +463,7 @@ by file descriptors. If you're starting with a Python file object *f*, first do ``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all internal buffers associated - with *f* are written to disk. Availability: Macintosh, Unix, and Windows - starting in 2.2.3. + with *f* are written to disk. Availability: Macintosh, Unix, and Windows. .. function:: ftruncate(fd, length) diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst index c3b9c8f..2194523 100644 --- a/Doc/library/pickle.rst +++ b/Doc/library/pickle.rst @@ -262,17 +262,6 @@ The :mod:`pickle` module also exports two callables [#]_, :class:`Pickler` and pickled by reference and not by value. This method is useful when re-using picklers. - .. note:: - - Prior to Python 2.3, :meth:`clear_memo` was only available on the picklers - created by :mod:`cPickle`. In the :mod:`pickle` module, picklers have an - instance variable called :attr:`memo` which is a Python dictionary. So to clear - the memo for a :mod:`pickle` module pickler, you could do the following:: - - mypickler.memo.clear() - - Code that does not need to support older versions of Python should simply use - :meth:`clear_memo`. It is possible to make multiple calls to the :meth:`dump` method of the same :class:`Pickler` instance. These must then be matched to the same number of diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst index 5f770f6..f763f2d 100644 --- a/Doc/library/profile.rst +++ b/Doc/library/profile.rst @@ -546,7 +546,7 @@ The object of this exercise is to get a fairly consistent result. If your computer is *very* fast, or your timer function has poor resolution, you might have to pass 100000, or even 1000000, to get consistent results. -When you have a consistent answer, there are three ways you can use it: [#]_ :: +When you have a consistent answer, there are three ways you can use it:: import profile @@ -616,8 +616,3 @@ The resulting profiler will then call :func:`your_time_func`. .. [#] Updated and converted to LaTeX by Guido van Rossum. Further updated by Armin Rigo to integrate the documentation for the new :mod:`cProfile` module of Python 2.5. - -.. [#] Prior to Python 2.2, it was necessary to edit the profiler source code to embed - the bias as a literal number. You still can, but that method is no longer - described, because no longer needed. - diff --git a/Doc/library/random.rst b/Doc/library/random.rst index afdff76..d8c3f5a 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -58,8 +58,6 @@ Bookkeeping functions: Return an object capturing the current internal state of the generator. This object can be passed to :func:`setstate` to restore the state. - State values produced in Python 2.6 cannot be loaded into earlier versions. - .. function:: setstate(state) diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 019652e..e3867c0 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1035,10 +1035,10 @@ recursion, you may encounter a :exc:`RuntimeError` exception with the message You can often restructure your regular expression to avoid recursion. -Starting with Python 2.3, simple uses of the ``*?`` pattern are special-cased to -avoid recursion. Thus, the above regular expression can avoid recursion by -being recast as ``Begin [a-zA-Z0-9_ ]*?end``. As a further benefit, such -regular expressions will run faster than their recursive equivalents. +Simple uses of the ``*?`` pattern are special-cased to avoid recursion. Thus, +the above regular expression can avoid recursion by being recast as ``Begin +[a-zA-Z0-9_ ]*?end``. As a further benefit, such regular expressions will run +faster than their recursive equivalents. search() vs. match() diff --git a/Doc/library/shlex.rst b/Doc/library/shlex.rst index 4c509d8..7d88610 100644 --- a/Doc/library/shlex.rst +++ b/Doc/library/shlex.rst @@ -43,15 +43,14 @@ The :mod:`shlex` module defines the following class: A :class:`shlex` instance or subclass instance is a lexical analyzer object. The initialization argument, if present, specifies where to read characters from. It must be a file-/stream-like object with :meth:`read` and - :meth:`readline` methods, or a string (strings are accepted since Python 2.3). - If no argument is given, input will be taken from ``sys.stdin``. The second - optional argument is a filename string, which sets the initial value of the - :attr:`infile` member. If the *instream* argument is omitted or equal to - ``sys.stdin``, this second argument defaults to "stdin". The *posix* argument - was introduced in Python 2.3, and defines the operational mode. When *posix* is - not true (default), the :class:`shlex` instance will operate in compatibility - mode. When operating in POSIX mode, :class:`shlex` will try to be as close as - possible to the POSIX shell parsing rules. + :meth:`readline` methods, or a string. If no argument is given, input will + be taken from ``sys.stdin``. The second optional argument is a filename + string, which sets the initial value of the :attr:`infile` member. If the + *instream* argument is omitted or equal to ``sys.stdin``, this second + argument defaults to "stdin". The *posix* argument defines the operational + mode: when *posix* is not true (default), the :class:`shlex` instance will + operate in compatibility mode. When operating in POSIX mode, :class:`shlex` + will try to be as close as possible to the POSIX shell parsing rules. .. seealso:: diff --git a/Doc/library/site.rst b/Doc/library/site.rst index 354043f..a574878 100644 --- a/Doc/library/site.rst +++ b/Doc/library/site.rst @@ -87,8 +87,6 @@ empty, and the path manipulations are skipped; however the import of A list of prefixes for site package directories - .. versionadded:: 2.6 - .. data:: ENABLE_USER_SITE @@ -96,32 +94,22 @@ empty, and the path manipulations are skipped; however the import of user site directory is enabled and added to sys.path. When the flag is None the user site directory is disabled for security reasons. - .. versionadded:: 2.6 - .. data:: USER_SITE Path to the user site directory for the current Python version or None - .. versionadded:: 2.6 - .. data:: USER_BASE Path to the base directory for user site directories - .. versionadded:: 2.6 - .. envvar:: PYTHONNOUSERSITE - .. versionadded:: 2.6 - .. envvar:: PYTHONUSERBASE - .. versionadded:: 2.6 - .. function:: addsitedir(sitedir, known_paths=None) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index a55ae70..9a3af1d 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -479,12 +479,6 @@ correspond to Unix system calls applicable to sockets. Bind the socket to *address*. The socket must not already be bound. (The format of *address* depends on the address family --- see above.) - .. note:: - - This method has historically accepted a pair of parameters for :const:`AF_INET` - addresses instead of only a tuple. This was never intentional and is no longer - available in Python 2.0 and later. - .. method:: socket.close() @@ -498,12 +492,6 @@ correspond to Unix system calls applicable to sockets. Connect to a remote socket at *address*. (The format of *address* depends on the address family --- see above.) - .. note:: - - This method has historically accepted a pair of parameters for :const:`AF_INET` - addresses instead of only a tuple. This was never intentional and is no longer - available in Python 2.0 and later. - .. method:: socket.connect_ex(address) @@ -514,12 +502,6 @@ correspond to Unix system calls applicable to sockets. :cdata:`errno` variable. This is useful to support, for example, asynchronous connects. - .. note:: - - This method has historically accepted a pair of parameters for :const:`AF_INET` - addresses instead of only a tuple. This was never intentional and is no longer - available in Python 2.0 and later. - .. method:: socket.fileno() diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index c910347..9e06a22 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1906,7 +1906,7 @@ Files have the following methods: which requires that the file be open will raise a :exc:`ValueError` after the file has been closed. Calling :meth:`close` more than once is allowed. - As of Python 2.5, you can avoid having to call this method explicitly if you use + You can avoid having to call this method explicitly if you use the :keyword:`with` statement. For example, the following code will automatically close *f* when the :keyword:`with` block is exited:: diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index f66899c..0929f0e 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -152,21 +152,18 @@ always available. .. warning:: - Assigning the *traceback* return value to a local variable in a function that is - handling an exception will cause a circular reference. This will prevent - anything referenced by a local variable in the same function or by the traceback - from being garbage collected. Since most functions don't need access to the - traceback, the best solution is to use something like ``exctype, value = - sys.exc_info()[:2]`` to extract only the exception type and value. If you do - need the traceback, make sure to delete it after use (best done with a - :keyword:`try` ... :keyword:`finally` statement) or to call :func:`exc_info` in - a function that does not itself handle an exception. - - .. note:: - - Beginning with Python 2.2, such cycles are automatically reclaimed when garbage - collection is enabled and they become unreachable, but it remains more efficient - to avoid creating cycles. + Assigning the *traceback* return value to a local variable in a function + that is handling an exception will cause a circular reference. Since most + functions don't need access to the traceback, the best solution is to use + something like ``exctype, value = sys.exc_info()[:2]`` to extract only the + exception type and value. If you do need the traceback, make sure to + delete it after use (best done with a :keyword:`try` + ... :keyword:`finally` statement) or to call :func:`exc_info` in a + function that does not itself handle an exception. + + Such cycles are normally automatically reclaimed when garbage collection + is enabled and they become unreachable, but it remains more efficient to + avoid creating cycles. .. data:: exec_prefix diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst index 4de9236..7363940 100644 --- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -14,14 +14,11 @@ pair: temporary; file This module generates temporary files and directories. It works on all -supported platforms. - -In version 2.3 of Python, this module was overhauled for enhanced security. It -now provides three new functions, :func:`NamedTemporaryFile`, :func:`mkstemp`, -and :func:`mkdtemp`, which should eliminate all remaining need to use the -insecure :func:`mktemp` function. Temporary file names created by this module -no longer contain the process ID; instead a string of six random characters is -used. +supported platforms. It provides three new functions, +:func:`NamedTemporaryFile`, :func:`mkstemp`, and :func:`mkdtemp`, which should +eliminate all remaining need to use the insecure :func:`mktemp` function. +Temporary file names created by this module no longer contain the process ID; +instead a string of six random characters is used. Also, all the user-callable functions now take additional arguments which allow direct control over the location and name of temporary files. It is @@ -208,10 +205,6 @@ the appropriate function arguments, instead. On Windows, the default prefix is :file:`~T`; on all other systems it is :file:`tmp`. - Older versions of this module used to require that ``template`` be set to - ``None`` after a call to :func:`os.fork`; this has not been necessary since - version 1.5.2. - .. function:: gettempprefix() diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst index 9b2ad11..243e43c 100644 --- a/Doc/library/textwrap.rst +++ b/Doc/library/textwrap.rst @@ -52,9 +52,7 @@ indentation from strings that have unwanted whitespace to the left of the text. Note that tabs and spaces are both treated as whitespace, but they are not equal: the lines ``" hello"`` and ``"\thello"`` are considered to have no - common leading whitespace. (This behaviour is new in Python 2.5; older versions - of this module incorrectly expanded tabs before searching for common leading - whitespace.) + common leading whitespace. For example:: diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst index 6a8a94d..495ac81 100644 --- a/Doc/library/timeit.rst +++ b/Doc/library/timeit.rst @@ -94,8 +94,8 @@ The module defines the following public class: timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit() -Starting with version 2.6, the module also defines two convenience functions: +The module also defines two convenience functions: .. function:: repeat(stmt[, setup[, timer[, repeat=3 [, number=1000000]]]]) diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index 2f29aae..389753a 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -122,14 +122,6 @@ The module defines the following functions: A shorthand for ``format_list(extract_stack(f, limit))``. -.. function:: tb_lineno(tb) - - This function returns the current line number set in the traceback object. This - function was necessary because in versions of Python prior to 2.3 when the - :option:`-O` flag was passed to Python the ``tb.tb_lineno`` was not updated - correctly. This function has no use in versions past 2.3. - - .. _traceback-example: Traceback Examples diff --git a/Doc/library/undoc.rst b/Doc/library/undoc.rst index 62157d4..b314530 100644 --- a/Doc/library/undoc.rst +++ b/Doc/library/undoc.rst @@ -149,7 +149,7 @@ in the build tree and either rebuilding Python if the modules are statically linked, or building and installing the shared object if using dynamically-loaded extensions. -.. (lib-old is empty as of Python 2.5) +.. XXX new explanation of lib-old necessary Those which are written in Python will be installed into the directory \file{lib-old/} installed as part of the standard library. To use diff --git a/Doc/library/urllib2.rst b/Doc/library/urllib2.rst index d6a5fbd..7987007 100644 --- a/Doc/library/urllib2.rst +++ b/Doc/library/urllib2.rst @@ -71,9 +71,8 @@ The :mod:`urllib2` module defines the following functions: If the Python installation has SSL support (i.e., if the :mod:`ssl` module can be imported), :class:`HTTPSHandler` will also be added. - Beginning in Python 2.3, a :class:`BaseHandler` subclass may also change its - :attr:`handler_order` member variable to modify its position in the handlers - list. + A :class:`BaseHandler` subclass may also change its :attr:`handler_order` + member variable to modify its position in the handlers list. The following exceptions are raised as appropriate: diff --git a/Doc/library/winsound.rst b/Doc/library/winsound.rst index 3088848..dfe3c84 100644 --- a/Doc/library/winsound.rst +++ b/Doc/library/winsound.rst @@ -20,13 +20,6 @@ provided by Windows platforms. It includes functions and several constants. parameter specifies the number of milliseconds the sound should last. If the system is not able to beep the speaker, :exc:`RuntimeError` is raised. - .. note:: - - Under Windows 95 and 98, the Windows :cfunc:`Beep` function exists but is - useless (it ignores its arguments). In that case Python simulates it via direct - port manipulation (added in version 2.1). It's unknown whether that will work - on all systems. - .. function:: PlaySound(sound, flags) diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst index bb3ad02..fb3f5cf 100644 --- a/Doc/library/xml.dom.minidom.rst +++ b/Doc/library/xml.dom.minidom.rst @@ -162,16 +162,6 @@ module documentation. This section lists the differences between the API and There's also an *encoding* argument; see :meth:`toxml`. -The following standard DOM methods have special considerations with -:mod:`xml.dom.minidom`: - -.. method:: Node.cloneNode(deep) - - Although this method was present in the version of :mod:`xml.dom.minidom` - packaged with Python 2.0, it was seriously broken. This has been corrected for - subsequent releases. - - .. _dom-example: DOM Example @@ -224,18 +214,18 @@ rules apply: :exc:`TypeError` and :exc:`AttributeError`. * :class:`NodeList` objects are implemented using Python's built-in list type. - Starting with Python 2.2, these objects provide the interface defined in the DOM - specification, but with earlier versions of Python they do not support the - official API. They are, however, much more "Pythonic" than the interface - defined in the W3C recommendations. + These objects provide the interface defined in the DOM specification, but with + earlier versions of Python they do not support the official API. They are, + however, much more "Pythonic" than the interface defined in the W3C + recommendations. The following interfaces have no implementation in :mod:`xml.dom.minidom`: * :class:`DOMTimeStamp` -* :class:`DocumentType` (added in Python 2.1) +* :class:`DocumentType` -* :class:`DOMImplementation` (added in Python 2.1) +* :class:`DOMImplementation` * :class:`CharacterData` diff --git a/Doc/library/xmlrpclib.rst b/Doc/library/xmlrpclib.rst index dd6a0cc..c1f13c3 100644 --- a/Doc/library/xmlrpclib.rst +++ b/Doc/library/xmlrpclib.rst @@ -86,9 +86,8 @@ between conformable Python objects and XML on the wire. raise a special :exc:`Fault` instance, used to signal XML-RPC server errors, or :exc:`ProtocolError` used to signal an error in the HTTP/HTTPS transport layer. Both :exc:`Fault` and :exc:`ProtocolError` derive from a base class called - :exc:`Error`. Note that even though starting with Python 2.2 you can subclass - builtin types, the xmlrpclib module currently does not marshal instances of such - subclasses. + :exc:`Error`. Note that the xmlrpclib module currently does not marshal + instances of subclasses of builtin types. When passing strings, characters special to XML such as ``<``, ``>``, and ``&`` will be automatically escaped. However, it's the caller's responsibility to |