mirror of
https://github.com/python/cpython.git
synced 2025-09-28 11:15:17 +00:00
Get rid of the remaining versionadded/versionchanged directives.
This commit is contained in:
parent
1617457cff
commit
55ac8f0f26
161 changed files with 335 additions and 2197 deletions
|
@ -488,8 +488,6 @@ The corresponding call to :func:`setup` might be::
|
|||
package_data={'mypkg': ['data/*.dat']},
|
||||
)
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
Installing Additional Files
|
||||
===========================
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
Uploading Packages to the Package Index
|
||||
***************************************
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
The Python Package Index (PyPI) not only stores the package info, but also the
|
||||
package data if the author of the package wishes to. The distutils command
|
||||
:command:`upload` pushes the distribution files to PyPI.
|
||||
|
|
|
@ -1125,8 +1125,6 @@ not been updated to use some of the new generic mechanism that is available.
|
|||
Generic Attribute Management
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
Most extension types only use *simple* attributes. So, what makes the
|
||||
attributes simple? There are only a couple of conditions that must be met:
|
||||
|
||||
|
|
|
@ -343,9 +343,6 @@ installed to the following directories under the installation base as follows:
|
|||
| data | :file:`{home}/share` | :option:`--install-data` |
|
||||
+------------------------------+---------------------------+-----------------------------+
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The :option:`--home` option used to be supported only on Unix.
|
||||
|
||||
|
||||
.. _inst-alt-install-home:
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ Abstract Syntax Trees
|
|||
.. sectionauthor:: Martin v. Löwis <martin@v.loewis.de>
|
||||
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
The ``_ast`` module helps Python applications to process trees of the Python
|
||||
abstract syntax grammar. The Python compiler currently provides read-only access
|
||||
to such trees, meaning that applications can only create a tree for a given
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Mark Hammond <MarkH@ActiveState.com>
|
||||
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
These functions expose the Windows registry API to Python. Instead of using an
|
||||
integer as the registry handle, a handle object is used to ensure that the
|
||||
handles are closed correctly, even if the programmer neglects to explicitly
|
||||
|
|
|
@ -59,9 +59,6 @@ The module defines the following type:
|
|||
from the optional *initializer* value, which must be a list, string, or iterable
|
||||
over elements of the appropriate type.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Formerly, only lists or strings were accepted.
|
||||
|
||||
If given a list or string, the initializer is passed to the new array's
|
||||
:meth:`fromlist`, :meth:`fromstring`, or :meth:`fromunicode` method (see below)
|
||||
to add initial items to the array. Otherwise, the iterable initializer is
|
||||
|
@ -135,9 +132,6 @@ The following data items and methods are also supported:
|
|||
be raised. If *iterable* is not an array, it must be iterable and its elements
|
||||
must be the right type to be appended to the array.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Formerly, the argument could only be another array.
|
||||
|
||||
|
||||
.. method:: array.fromfile(f, n)
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Skip Montanaro <skip@mojam.com>
|
||||
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
The :mod:`atexit` module defines functions to register and unregister cleanup
|
||||
functions. Functions thus registered are automatically executed upon normal
|
||||
interpreter termination.
|
||||
|
@ -36,9 +34,8 @@ is killed by a signal, when a Python fatal internal error is detected, or when
|
|||
saved. After all exit handlers have had a chance to run the last exception to
|
||||
be raised is re-raised.
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
This function now returns *func* which makes it possible to use it as a
|
||||
decorator without binding the original name to ``None``.
|
||||
This function returns *func* which makes it possible to use it as a decorator
|
||||
without binding the original name to ``None``.
|
||||
|
||||
|
||||
.. function:: unregister(func)
|
||||
|
@ -47,8 +44,6 @@ is killed by a signal, when a Python fatal internal error is detected, or when
|
|||
shutdown. After calling :func:`unregister`, *func* is guaranteed not to be
|
||||
called when the interpreter shuts down.
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
|
||||
.. seealso::
|
||||
|
||||
|
|
|
@ -53,8 +53,6 @@ The module defines the following variables and functions:
|
|||
a-LAW encoding always uses 8 bits samples, so *width* refers only to the sample
|
||||
width of the output fragment here.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: avg(fragment, width)
|
||||
|
||||
|
@ -133,8 +131,6 @@ The module defines the following variables and functions:
|
|||
range of about 13 bits using only 8 bit samples. It is used by the Sun audio
|
||||
hardware, among others.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: lin2lin(fragment, width, newwidth)
|
||||
|
||||
|
|
|
@ -228,9 +228,6 @@ A :class:`BaseHTTPRequestHandler` instance has the following methods:
|
|||
|
||||
The result looks like ``'Sun, 06 Nov 1994 08:49:37 GMT'``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
The *timestamp* parameter.
|
||||
|
||||
|
||||
.. method:: BaseHTTPRequestHandler.log_date_time_string()
|
||||
|
||||
|
|
|
@ -30,16 +30,12 @@ The following functions are provided:
|
|||
existing entries. The return value is suitable for use as the first parameter
|
||||
to ``list.insert()``. This assumes that *list* is already sorted.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. function:: bisect_right(list, item[, lo[, hi]])
|
||||
|
||||
Similar to :func:`bisect_left`, but returns an insertion point which comes after
|
||||
(to the right of) any existing entries of *item* in *list*.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. function:: bisect(...)
|
||||
|
||||
|
@ -52,16 +48,12 @@ The following functions are provided:
|
|||
``list.insert(bisect.bisect_left(list, item, lo, hi), item)``. This assumes
|
||||
that *list* is already sorted.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. function:: insort_right(list, item[, lo[, hi]])
|
||||
|
||||
Similar to :func:`insort_left`, but inserting *item* in *list* after any
|
||||
existing entries of *item*.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. function:: insort(...)
|
||||
|
||||
|
|
|
@ -83,16 +83,12 @@ arguments should be used in most instances.
|
|||
Wrapper class around a DB object that supports string keys (rather than bytes).
|
||||
All keys are encoded as UTF-8, then passed to the underlying object.
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
|
||||
.. class:: StringValues(db)
|
||||
|
||||
Wrapper class around a DB object that supports string values (rather than bytes).
|
||||
All values are encoded as UTF-8, then passed to the underlying object.
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
|
||||
.. seealso::
|
||||
|
||||
|
@ -108,9 +104,6 @@ Hash, BTree and Record Objects
|
|||
Once instantiated, hash, btree and record objects support the same methods as
|
||||
dictionaries. In addition, they support the methods listed below.
|
||||
|
||||
.. versionchanged:: 2.3.1
|
||||
Added dictionary methods.
|
||||
|
||||
|
||||
.. method:: bsddbobject.close()
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Gustavo Niemeyer <niemeyer@conectiva.com>
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
This module provides a comprehensive interface for the bz2 compression library.
|
||||
It implements a complete file interface, one-shot (de)compression functions, and
|
||||
types for sequential (de)compression.
|
||||
|
|
|
@ -32,11 +32,9 @@ it's the base calendar for all computations.
|
|||
preparing the calendar data for formatting. This class doesn't do any formatting
|
||||
itself. This is the job of subclasses.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
:class:`Calendar` instances have the following methods:
|
||||
|
||||
|
||||
.. method:: Calendar.iterweekdays(weekday)
|
||||
|
||||
Return an iterator for the week day numbers that will be used for one week. The
|
||||
|
@ -109,11 +107,9 @@ it's the base calendar for all computations.
|
|||
|
||||
This class can be used to generate plain text calendars.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
:class:`TextCalendar` instances have the following methods:
|
||||
|
||||
|
||||
.. method:: TextCalendar.formatmonth(theyear, themonth[, w[, l]])
|
||||
|
||||
Return a month's calendar in a multi-line string. If *w* is provided, it
|
||||
|
@ -145,11 +141,9 @@ it's the base calendar for all computations.
|
|||
|
||||
This class can be used to generate HTML calendars.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
:class:`HTMLCalendar` instances have the following methods:
|
||||
|
||||
|
||||
.. method:: HTMLCalendar.formatmonth(theyear, themonth[, withyear])
|
||||
|
||||
Return a month's calendar as an HTML table. If *withyear* is true the year will
|
||||
|
@ -178,8 +172,6 @@ it's the base calendar for all computations.
|
|||
this locale includes an encoding all strings containing month and weekday names
|
||||
will be returned as unicode.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. class:: LocaleHTMLCalendar([firstweekday[, locale]])
|
||||
|
||||
|
@ -188,11 +180,9 @@ it's the base calendar for all computations.
|
|||
this locale includes an encoding all strings containing month and weekday names
|
||||
will be returned as unicode.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
For simple text calendars this module provides the following functions.
|
||||
|
||||
|
||||
.. function:: setfirstweekday(weekday)
|
||||
|
||||
Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The
|
||||
|
@ -203,15 +193,11 @@ For simple text calendars this module provides the following functions.
|
|||
import calendar
|
||||
calendar.setfirstweekday(calendar.SUNDAY)
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. function:: firstweekday()
|
||||
|
||||
Returns the current setting for the weekday to start each week.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. function:: isleap(year)
|
||||
|
||||
|
@ -223,9 +209,7 @@ For simple text calendars this module provides the following functions.
|
|||
Returns the number of leap years in the range from *y1* to *y2* (exclusive),
|
||||
where *y1* and *y2* are years.
|
||||
|
||||
.. versionchanged:: 2.0
|
||||
This function didn't work for ranges spanning a century change in Python
|
||||
1.5.2.
|
||||
This function works for ranges spanning a century change.
|
||||
|
||||
|
||||
.. function:: weekday(year, month, day)
|
||||
|
@ -263,8 +247,6 @@ For simple text calendars this module provides the following functions.
|
|||
Returns a month's calendar in a multi-line string using the :meth:`formatmonth`
|
||||
of the :class:`TextCalendar` class.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. function:: prcal(year[, w[, l[c]]])
|
||||
|
||||
|
@ -276,8 +258,6 @@ For simple text calendars this module provides the following functions.
|
|||
Returns a 3-column calendar for an entire year as a multi-line string using the
|
||||
:meth:`formatyear` of the :class:`TextCalendar` class.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. function:: timegm(tuple)
|
||||
|
||||
|
@ -286,11 +266,9 @@ For simple text calendars this module provides the following functions.
|
|||
Unix timestamp value, assuming an epoch of 1970, and the POSIX encoding. In
|
||||
fact, :func:`time.gmtime` and :func:`timegm` are each others' inverse.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
The :mod:`calendar` module exports the following data attributes:
|
||||
|
||||
|
||||
.. data:: day_name
|
||||
|
||||
An array that represents the days of the week in the current locale.
|
||||
|
|
|
@ -164,8 +164,6 @@ actually be instances of the class :class:`MiniFieldStorage`. In this case, the
|
|||
Higher Level Interface
|
||||
----------------------
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
The previous section explains how to read CGI form data using the
|
||||
:class:`FieldStorage` class. This section describes a higher level interface
|
||||
which was added to this class to allow one to do it in a more readable and
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
|
||||
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
.. index::
|
||||
single: CGI; exceptions
|
||||
single: CGI; tracebacks
|
||||
|
|
|
@ -84,9 +84,6 @@ The functions are:
|
|||
specified, returns the natural logarithm of *x*. There is one branch cut, from 0
|
||||
along the negative real axis to -∞, continuous from above.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
*base* argument added.
|
||||
|
||||
|
||||
.. function:: log10(x)
|
||||
|
||||
|
|
|
@ -28,9 +28,6 @@ interface.
|
|||
objects that the Cmd instance or subclass instance will use for input and
|
||||
output. If not specified, they will default to *sys.stdin* and *sys.stdout*.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
The *stdin* and *stdout* parameters were added.
|
||||
|
||||
|
||||
.. _cmd-objects:
|
||||
|
||||
|
|
|
@ -118,8 +118,6 @@ functions which use :func:`lookup` for the codec lookup:
|
|||
Raises a :exc:`LookupError` in case the encoding cannot be found or the codec
|
||||
doesn't support an incremental encoder.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: getincrementaldecoder(encoding)
|
||||
|
||||
|
@ -129,8 +127,6 @@ functions which use :func:`lookup` for the codec lookup:
|
|||
Raises a :exc:`LookupError` in case the encoding cannot be found or the codec
|
||||
doesn't support an incremental decoder.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: getreader(encoding)
|
||||
|
||||
|
@ -245,8 +241,6 @@ utility functions:
|
|||
*iterable*. This function is a generator. *errors* (as well as any other keyword
|
||||
argument) is passed through to the incremental encoder.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: iterdecode(iterable, encoding[, errors])
|
||||
|
||||
|
@ -254,8 +248,6 @@ utility functions:
|
|||
*iterable*. This function is a generator. *errors* (as well as any other keyword
|
||||
argument) is passed through to the incremental decoder.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
The module also provides the following constants which are useful for reading
|
||||
and writing to platform dependent files:
|
||||
|
||||
|
@ -390,8 +382,6 @@ encoded/decoded with the stateless encoder/decoder.
|
|||
IncrementalEncoder Objects
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
The :class:`IncrementalEncoder` class is used for encoding an input in multiple
|
||||
steps. It defines the following methods which every incremental encoder must
|
||||
define in order to be compatible with the Python codec registry.
|
||||
|
@ -447,16 +437,12 @@ define in order to be compatible with the Python codec registry.
|
|||
marshaling/pickling the state and encoding the bytes of the resulting string
|
||||
into an integer).
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
|
||||
.. method:: IncrementalEncoder.setstate(state)
|
||||
|
||||
Set the state of the encoder to *state*. *state* must be an encoder state
|
||||
returned by :meth:`getstate`.
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
|
||||
.. _incremental-decoder-objects:
|
||||
|
||||
|
@ -524,16 +510,12 @@ define in order to be compatible with the Python codec registry.
|
|||
marshaling/pickling the info and encoding the bytes of the resulting string into
|
||||
an integer.)
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
|
||||
.. method:: IncrementalDecoder.setstate(state)
|
||||
|
||||
Set the state of the encoder to *state*. *state* must be a decoder state
|
||||
returned by :meth:`getstate`.
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
The :class:`StreamWriter` and :class:`StreamReader` classes provide generic
|
||||
working interfaces which can be used to implement new encoding submodules very
|
||||
easily. See :mod:`encodings.utf_8` for an example of how this is done.
|
||||
|
@ -661,12 +643,6 @@ compatible with the Python codec registry.
|
|||
e.g. if optional encoding endings or state markers are available on the stream,
|
||||
these should be read too.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
*chars* argument added.
|
||||
|
||||
.. versionchanged:: 2.4.2
|
||||
*firstline* argument added.
|
||||
|
||||
|
||||
.. method:: StreamReader.readline([size[, keepends]])
|
||||
|
||||
|
@ -677,9 +653,6 @@ compatible with the Python codec registry.
|
|||
|
||||
If *keepends* is false line-endings will be stripped from the lines returned.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
*keepends* argument added.
|
||||
|
||||
|
||||
.. method:: StreamReader.readlines([sizehint[, keepends]])
|
||||
|
||||
|
@ -1157,9 +1130,6 @@ the table.
|
|||
| | | | operand |
|
||||
+--------------------+---------+----------------+---------------------------+
|
||||
|
||||
.. versionadded:: 2.3
|
||||
The ``idna`` and ``punycode`` encodings.
|
||||
|
||||
|
||||
:mod:`encodings.idna` --- Internationalized Domain Names in Applications
|
||||
------------------------------------------------------------------------
|
||||
|
@ -1168,8 +1138,6 @@ the table.
|
|||
:synopsis: Internationalized Domain Names implementation
|
||||
.. moduleauthor:: Martin v. Löwis
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
This module implements :rfc:`3490` (Internationalized Domain Names in
|
||||
Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for
|
||||
Internationalized Domain Names (IDN)). It builds upon the ``punycode`` encoding
|
||||
|
@ -1229,8 +1197,6 @@ functions can be used directly if desired.
|
|||
:synopsis: UTF-8 codec with BOM signature
|
||||
.. moduleauthor:: Walter Dörwald
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
This module implements a variant of the UTF-8 codec: On encoding a UTF-8 encoded
|
||||
BOM will be prepended to the UTF-8 encoded bytes. For the stateful encoder this
|
||||
is only done once (on the first write to the byte stream). For decoding an
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Raymond Hettinger <python@rcn.com>
|
||||
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
This module implements high-performance container datatypes. Currently,
|
||||
there are two datatypes, :class:`deque` and :class:`defaultdict`, and
|
||||
one datatype factory function, :func:`NamedTuple`. Python already
|
||||
|
@ -21,12 +19,6 @@ or file based ordered dictionaries with string keys.
|
|||
Future editions of the standard library may include balanced trees and
|
||||
ordered dictionaries.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added :class:`defaultdict`.
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
Added :class:`NamedTuple`.
|
||||
|
||||
|
||||
.. _deque-objects:
|
||||
|
||||
|
@ -49,11 +41,9 @@ ordered dictionaries.
|
|||
``pop(0)`` and ``insert(0, v)`` operations which change both the size and
|
||||
position of the underlying data representation.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
Deque objects support the following methods:
|
||||
|
||||
|
||||
.. method:: deque.append(x)
|
||||
|
||||
Add *x* to the right side of the deque.
|
||||
|
@ -99,8 +89,6 @@ Deque objects support the following methods:
|
|||
Removed the first occurrence of *value*. If not found, raises a
|
||||
:exc:`ValueError`.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. method:: deque.rotate(n)
|
||||
|
||||
|
@ -256,12 +244,10 @@ two adjacent nodes into one by grouping them in a list::
|
|||
as if they were passed to the :class:`dict` constructor, including keyword
|
||||
arguments.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
:class:`defaultdict` objects support the following method in addition to the
|
||||
standard :class:`dict` operations:
|
||||
|
||||
|
||||
.. method:: defaultdict.__missing__(key)
|
||||
|
||||
If the :attr:`default_factory` attribute is ``None``, this raises an
|
||||
|
@ -372,8 +358,6 @@ Setting the :attr:`default_factory` to :class:`set` makes the
|
|||
helpful docstring (with typename and fieldnames) and a helpful :meth:`__repr__`
|
||||
method which lists the tuple contents in a ``name=value`` format.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
The *fieldnames* are specified in a single string and are separated by spaces.
|
||||
Any valid Python identifier may be used for a field name.
|
||||
|
||||
|
|
|
@ -63,11 +63,6 @@ write-back, as will be the keys within each section.
|
|||
options within a section, and for the default values. This class does not
|
||||
support the magical interpolation behavior.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
*dict_type* was added.
|
||||
|
||||
|
||||
.. class:: ConfigParser([defaults])
|
||||
|
||||
|
@ -94,8 +89,6 @@ write-back, as will be the keys within each section.
|
|||
|
||||
.. % XXX Need to explain what's safer/more predictable about it.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. exception:: NoSectionError
|
||||
|
||||
|
@ -131,16 +124,12 @@ write-back, as will be the keys within each section.
|
|||
Exception raised when an option referenced from a value does not exist. Subclass
|
||||
of :exc:`InterpolationError`.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. exception:: InterpolationSyntaxError
|
||||
|
||||
Exception raised when the source text into which substitutions are made does not
|
||||
conform to the required syntax. Subclass of :exc:`InterpolationError`.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. exception:: MissingSectionHeaderError
|
||||
|
||||
|
@ -206,8 +195,6 @@ RawConfigParser Objects
|
|||
If the given section exists, and contains the given option, return
|
||||
:const:`True`; otherwise return :const:`False`.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
|
||||
.. method:: RawConfigParser.read(filenames)
|
||||
|
||||
|
@ -229,9 +216,6 @@ RawConfigParser Objects
|
|||
config.readfp(open('defaults.cfg'))
|
||||
config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')])
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Returns list of successfully parsed filenames.
|
||||
|
||||
|
||||
.. method:: RawConfigParser.readfp(fp[, filename])
|
||||
|
||||
|
@ -281,16 +265,12 @@ RawConfigParser Objects
|
|||
true) for *internal* storage of non-string values, full functionality (including
|
||||
interpolation and output to files) can only be achieved using string values.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
|
||||
.. method:: RawConfigParser.write(fileobject)
|
||||
|
||||
Write a representation of the configuration to the specified file object. This
|
||||
representation can be parsed by a future :meth:`read` call.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
|
||||
.. method:: RawConfigParser.remove_option(section, option)
|
||||
|
||||
|
@ -298,8 +278,6 @@ RawConfigParser Objects
|
|||
not exist, raise :exc:`NoSectionError`. If the option existed to be removed,
|
||||
return :const:`True`; otherwise return :const:`False`.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
|
||||
.. method:: RawConfigParser.remove_section(section)
|
||||
|
||||
|
@ -339,8 +317,6 @@ The :class:`ConfigParser` class extends some methods of the
|
|||
Return a list of ``(name, value)`` pairs for each option in the given *section*.
|
||||
Optional arguments have the same meaning as for the :meth:`get` method.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. _safeconfigparser-objects:
|
||||
|
||||
|
@ -357,5 +333,3 @@ The :class:`SafeConfigParser` class implements the same extended interface as
|
|||
otherwise raise :exc:`NoSectionError`. *value* must be a string (:class:`str`
|
||||
or :class:`unicode`); if not, :exc:`TypeError` is raised.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
|
|
@ -5,19 +5,17 @@ Built-in Constants
|
|||
A small number of constants live in the built-in namespace. They are:
|
||||
|
||||
|
||||
.. XXX False, True, None are keywords too
|
||||
|
||||
.. data:: False
|
||||
|
||||
The false value of the :class:`bool` type.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: True
|
||||
|
||||
The true value of the :class:`bool` type.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: None
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
:synopsis: Utilities for with-statement contexts.
|
||||
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
This module provides utilities for common tasks involving the :keyword:`with`
|
||||
statement. For more information see also :ref:`typecontextmanager` and
|
||||
:ref:`context-managers`.
|
||||
|
|
|
@ -110,10 +110,6 @@ Cookie Objects
|
|||
to join the headers together, and is by default the combination ``'\r\n'``
|
||||
(CRLF).
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The default separator has been changed from ``'\n'`` to match the cookie
|
||||
specification.
|
||||
|
||||
|
||||
.. method:: BaseCookie.js_output([attrs])
|
||||
|
||||
|
|
|
@ -8,10 +8,6 @@
|
|||
.. sectionauthor:: John J. Lee <jjl@pobox.com>
|
||||
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
|
||||
The :mod:`cookielib` module defines classes for automatic handling of HTTP
|
||||
cookies. It is useful for accessing web sites that require small pieces of data
|
||||
-- :dfn:`cookies` -- to be set on the client machine by an HTTP response from a
|
||||
|
@ -517,19 +513,17 @@ all be assigned to.
|
|||
case RFC 2109 cookies are downgraded if and only if RFC 2965 handling is turned
|
||||
off. Therefore, RFC 2109 cookies are downgraded by default.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
General strictness switches:
|
||||
|
||||
|
||||
.. attribute:: DefaultCookiePolicy.strict_domain
|
||||
|
||||
Don't allow sites to set two-component domains with country-code top-level
|
||||
domains like ``.co.uk``, ``.gov.uk``, ``.co.nz``.etc. This is far from perfect
|
||||
and isn't guaranteed to work!
|
||||
|
||||
RFC 2965 protocol strictness switches:
|
||||
|
||||
RFC 2965 protocol strictness switches:
|
||||
|
||||
.. attribute:: DefaultCookiePolicy.strict_rfc2965_unverifiable
|
||||
|
||||
|
@ -538,8 +532,8 @@ RFC 2965 protocol strictness switches:
|
|||
another site). If this is false, cookies are *never* blocked on the basis of
|
||||
verifiability
|
||||
|
||||
Netscape protocol strictness switches:
|
||||
|
||||
Netscape protocol strictness switches:
|
||||
|
||||
.. attribute:: DefaultCookiePolicy.strict_ns_unverifiable
|
||||
|
||||
|
@ -683,8 +677,6 @@ internal consistency, so you should know what you're doing if you do that.
|
|||
:mod:`cookielib` may 'downgrade' RFC 2109 cookies to Netscape cookies, in
|
||||
which case :attr:`version` is 0.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. attribute:: Cookie.port_specified
|
||||
|
||||
|
|
|
@ -54,9 +54,6 @@ file, socket, window, array, or any similar types. It does "copy" functions and
|
|||
classes (shallow and deeply), by returning the original object unchanged; this
|
||||
is compatible with the way these are treated by the :mod:`pickle` module.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added copying functions.
|
||||
|
||||
.. index:: module: pickle
|
||||
|
||||
Classes can use the same interfaces to control copying that they use to control
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
.. sectionauthor:: Skip Montanaro <skip@pobox.com>
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
.. index::
|
||||
single: csv
|
||||
pair: data; tabular
|
||||
|
@ -77,8 +75,7 @@ The :mod:`csv` module defines the following functions:
|
|||
All data read are returned as strings. No automatic data type conversion is
|
||||
performed.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The parser is now stricter with respect to multi-line quoted fields. Previously,
|
||||
The parser is quite strict with respect to multi-line quoted fields. Previously,
|
||||
if a line ended within a quoted field without a terminating newline character, a
|
||||
newline would be inserted into the returned field. This behavior caused problems
|
||||
when reading files which contained carriage return characters within fields.
|
||||
|
@ -138,11 +135,9 @@ The :mod:`csv` module defines the following functions:
|
|||
Returns the current maximum field size allowed by the parser. If *new_limit* is
|
||||
given, this becomes the new limit.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
The :mod:`csv` module defines the following classes:
|
||||
|
||||
|
||||
.. class:: DictReader(csvfile[, fieldnames=:const:None,[, restkey=:const:None[, restval=None[, dialect='excel'[, *args, **kwds]]]]])
|
||||
|
||||
Create an object which operates like a regular reader but maps the information
|
||||
|
@ -352,7 +347,6 @@ Reader objects have the following public attributes:
|
|||
The number of lines read from the source iterator. This is not the same as the
|
||||
number of records returned, as records can span multiple lines.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
Writer Objects
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
.. moduleauthor:: Thomas Heller <theller@python.net>
|
||||
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
``ctypes`` is a foreign function library for Python. It provides C compatible
|
||||
data types, and allows calling functions in dlls/shared libraries. It can be
|
||||
used to wrap these libraries in pure Python.
|
||||
|
@ -2209,8 +2207,6 @@ These are the fundamental ctypes data types:
|
|||
can be True or False, and the constructor accepts any object that has a truth
|
||||
value.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
|
||||
.. class:: HRESULT
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Eric S. Raymond <esr@thyrsus.com>
|
||||
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
The :mod:`curses.ascii` module supplies name constants for ASCII characters and
|
||||
functions to test membership in various ASCII character classes. The constants
|
||||
supplied are names for control characters as follows:
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
.. sectionauthor:: Eric Raymond <esr@thyrsus.com>
|
||||
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
Added support for the ``ncurses`` library and converted to a package.
|
||||
|
||||
The :mod:`curses` module provides an interface to the curses library, the
|
||||
de-facto standard for portable advanced terminal handling.
|
||||
|
||||
|
@ -1520,8 +1517,6 @@ The following table lists the predefined colors:
|
|||
.. sectionauthor:: Eric Raymond <esr@thyrsus.com>
|
||||
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
The :mod:`curses.textpad` module provides a :class:`Textbox` class that handles
|
||||
elementary text editing in a curses window, supporting a set of keybindings
|
||||
resembling those of Emacs (thus, also of Netscape Navigator, BBedit 6.x,
|
||||
|
@ -1656,8 +1651,6 @@ You can instantiate a :class:`Textbox` object as follows:
|
|||
.. sectionauthor:: Eric Raymond <esr@thyrsus.com>
|
||||
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
This module supplies one function, :func:`wrapper`, which runs another function
|
||||
which should be the rest of your curses-using application. If the application
|
||||
raises an exception, :func:`wrapper` will restore the terminal to a sane state
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
.. sectionauthor:: A.M. Kuchling <amk@amk.ca>
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
The :mod:`datetime` module supplies classes for manipulating dates and times in
|
||||
both simple and complex ways. While date and time arithmetic is supported, the
|
||||
focus of the implementation is on efficient member extraction for output
|
||||
|
@ -604,7 +602,6 @@ Other constructors, all class methods:
|
|||
can't be parsed by :func:`time.strptime` or if it returns a value which isn't a
|
||||
time tuple.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
Class attributes:
|
||||
|
||||
|
|
|
@ -5,19 +5,14 @@
|
|||
.. module:: decimal
|
||||
:synopsis: Implementation of the General Decimal Arithmetic Specification.
|
||||
|
||||
|
||||
.. moduleauthor:: Eric Price <eprice at tjhsst.edu>
|
||||
.. moduleauthor:: Facundo Batista <facundo at taniquetil.com.ar>
|
||||
.. moduleauthor:: Raymond Hettinger <python at rcn.com>
|
||||
.. moduleauthor:: Aahz <aahz at pobox.com>
|
||||
.. moduleauthor:: Tim Peters <tim.one at comcast.net>
|
||||
|
||||
|
||||
.. sectionauthor:: Raymond D. Hettinger <python at rcn.com>
|
||||
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
The :mod:`decimal` module provides support for decimal floating point
|
||||
arithmetic. It offers several advantages over the :class:`float()` datatype:
|
||||
|
||||
|
@ -436,8 +431,6 @@ the :func:`localcontext` function to temporarily change the active context.
|
|||
when exiting the with-statement. If no context is specified, a copy of the
|
||||
current context is used.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
For example, the following code sets the current decimal precision to 42 places,
|
||||
performs a calculation, and then automatically restores the previous context::
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
|
||||
.. % LaTeXification by Fred L. Drake, Jr. <fdrake@acm.org>.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. class:: SequenceMatcher
|
||||
|
||||
This is a flexible class for comparing pairs of sequences of any type, so long
|
||||
|
@ -117,8 +114,6 @@
|
|||
:file:`Tools/scripts/diff.py` is a command-line front-end to this class and
|
||||
contains a good example of its use.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: context_diff(a, b[, fromfile][, tofile][, fromfiledate][, tofiledate][, n][, lineterm])
|
||||
|
||||
|
@ -146,8 +141,6 @@
|
|||
|
||||
:file:`Tools/scripts/diff.py` is a command-line front-end for this function.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: get_close_matches(word, possibilities[, n][, cutoff])
|
||||
|
||||
|
@ -263,8 +256,6 @@
|
|||
|
||||
:file:`Tools/scripts/diff.py` is a command-line front-end for this function.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: IS_LINE_JUNK(line)
|
||||
|
||||
|
@ -382,12 +373,6 @@ use :meth:`set_seq2` to set the commonly used sequence once and call
|
|||
then ``i+n != i'`` or ``j+n != j'``; in other words, adjacent triples always
|
||||
describe non-adjacent equal blocks.
|
||||
|
||||
.. % Explain why a dummy is used!
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The guarantee that adjacent triples always describe non-adjacent blocks was
|
||||
implemented.
|
||||
|
||||
::
|
||||
|
||||
>>> s = SequenceMatcher(None, "abxcd", "abcd")
|
||||
|
@ -445,8 +430,6 @@ use :meth:`set_seq2` to set the commonly used sequence once and call
|
|||
|
||||
The groups are returned in the same format as :meth:`get_opcodes`.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: SequenceMatcher.ratio()
|
||||
|
||||
|
|
|
@ -290,9 +290,6 @@ strings are treated as if they were docstrings. In output, a key ``K`` in
|
|||
Any classes found are recursively searched similarly, to test docstrings in
|
||||
their contained methods and nested classes.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
A "private name" concept is deprecated and no longer documented.
|
||||
|
||||
|
||||
.. _doctest-finding-examples:
|
||||
|
||||
|
@ -305,10 +302,6 @@ hard tab characters are expanded to spaces, using 8-column tab stops. If you
|
|||
don't believe tabs should mean that, too bad: don't use hard tabs, or write
|
||||
your own :class:`DocTestParser` class.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Expanding tabs to spaces is new; previous versions tried to preserve hard tabs,
|
||||
with confusing results.
|
||||
|
||||
::
|
||||
|
||||
>>> # comments are ignored
|
||||
|
@ -338,10 +331,6 @@ The fine print:
|
|||
blank line, put ``<BLANKLINE>`` in your doctest example each place a blank line
|
||||
is expected.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
``<BLANKLINE>`` was added; there was no way to use expected output containing
|
||||
empty lines in previous versions.
|
||||
|
||||
* Output to stdout is captured, but not output to stderr (exception tracebacks
|
||||
are captured via a different means).
|
||||
|
||||
|
@ -498,10 +487,6 @@ Some details you should read once, but won't need to remember:
|
|||
^
|
||||
SyntaxError: invalid syntax
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The ability to handle a multi-line exception detail, and the
|
||||
:const:`IGNORE_EXCEPTION_DETAIL` doctest option, were added.
|
||||
|
||||
|
||||
.. _doctest-options:
|
||||
|
||||
|
@ -663,7 +648,7 @@ two blanks before the single-digit list elements, and because the actual output
|
|||
is on a single line. This test also passes, and also requires a directive to do
|
||||
so::
|
||||
|
||||
>>> print range(20) # doctest:+ELLIPSIS
|
||||
>>> print range(20) # doctest: +ELLIPSIS
|
||||
[0, 1, ..., 18, 19]
|
||||
|
||||
Multiple directives can be used on a single physical line, separated by commas::
|
||||
|
@ -692,17 +677,6 @@ usually the only meaningful choice. However, option flags can also be passed to
|
|||
functions that run doctests, establishing different defaults. In such cases,
|
||||
disabling an option via ``-`` in a directive can be useful.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Constants :const:`DONT_ACCEPT_BLANKLINE`, :const:`NORMALIZE_WHITESPACE`,
|
||||
:const:`ELLIPSIS`, :const:`IGNORE_EXCEPTION_DETAIL`, :const:`REPORT_UDIFF`,
|
||||
:const:`REPORT_CDIFF`, :const:`REPORT_NDIFF`,
|
||||
:const:`REPORT_ONLY_FIRST_FAILURE`, :const:`COMPARISON_FLAGS` and
|
||||
:const:`REPORTING_FLAGS` were added; by default ``<BLANKLINE>`` in expected
|
||||
output matches an empty line in actual output; and doctest directives were
|
||||
added.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Constant :const:`SKIP` was added.
|
||||
|
||||
There's also a way to register new option flag names, although this isn't useful
|
||||
unless you intend to extend :mod:`doctest` internals via subclassing:
|
||||
|
@ -718,8 +692,6 @@ unless you intend to extend :mod:`doctest` internals via subclassing:
|
|||
|
||||
MY_FLAG = register_optionflag('MY_FLAG')
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. _doctest-warnings:
|
||||
|
||||
|
@ -868,11 +840,6 @@ and :ref:`doctest-simple-testfile`.
|
|||
Optional argument *encoding* specifies an encoding that should be used to
|
||||
convert the file to unicode.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The parameter *encoding* was added.
|
||||
|
||||
|
||||
.. function:: testmod([m][, name][, globs][, verbose][, report][, optionflags][, extraglobs][, raise_on_error][, exclude_empty])
|
||||
|
||||
|
@ -906,14 +873,6 @@ and :ref:`doctest-simple-testfile`.
|
|||
*raise_on_error*, and *globs* are the same as for function :func:`testfile`
|
||||
above, except that *globs* defaults to ``m.__dict__``.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
The parameter *optionflags* was added.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The parameters *extraglobs*, *raise_on_error* and *exclude_empty* were added.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The optional argument *isprivate*, deprecated in 2.4, was removed.
|
||||
|
||||
There's also a function to run the doctests associated with a single object.
|
||||
This function is provided for backward compatibility. There are no plans to
|
||||
|
@ -1031,15 +990,9 @@ from text files and modules with doctests:
|
|||
Optional argument *encoding* specifies an encoding that should be used to
|
||||
convert the file to unicode.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The global ``__file__`` was added to the globals provided to doctests loaded
|
||||
The global ``__file__`` is added to the globals provided to doctests loaded
|
||||
from a text file using :func:`DocFileSuite`.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The parameter *encoding* was added.
|
||||
|
||||
|
||||
.. function:: DocTestSuite([module][, globs][, extraglobs][, test_finder][, setUp][, tearDown][, checker])
|
||||
|
||||
|
@ -1068,12 +1021,8 @@ from text files and modules with doctests:
|
|||
Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as for
|
||||
function :func:`DocFileSuite` above.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
This function uses the same search technique as :func:`testmod`.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The parameters *globs*, *extraglobs*, *test_finder*, *setUp*, *tearDown*, and
|
||||
*optionflags* were added; this function now uses the same search technique as
|
||||
:func:`testmod`.
|
||||
|
||||
Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` out
|
||||
of :class:`doctest.DocTestCase` instances, and :class:`DocTestCase` is a
|
||||
|
@ -1119,8 +1068,6 @@ reporting flags specific to :mod:`unittest` support, via this function:
|
|||
The value of the :mod:`unittest` reporting flags in effect before the function
|
||||
was called is returned by the function.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. _doctest-advanced-api:
|
||||
|
||||
|
@ -1181,7 +1128,6 @@ DocTest Objects
|
|||
constructor arguments are used to initialize the member variables of the same
|
||||
names.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
:class:`DocTest` defines the following member variables. They are initialized
|
||||
by the constructor, and should not be modified directly.
|
||||
|
@ -1239,7 +1185,6 @@ Example Objects
|
|||
output. The constructor arguments are used to initialize the member variables
|
||||
of the same names.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
:class:`Example` defines the following member variables. They are initialized
|
||||
by the constructor, and should not be modified directly.
|
||||
|
@ -1316,7 +1261,6 @@ DocTestFinder objects
|
|||
If the optional argument *exclude_empty* is false, then
|
||||
:meth:`DocTestFinder.find` will include tests for objects with empty docstrings.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
:class:`DocTestFinder` defines the following method:
|
||||
|
||||
|
@ -1369,7 +1313,6 @@ DocTestParser objects
|
|||
A processing class used to extract interactive examples from a string, and use
|
||||
them to create a :class:`DocTest` object.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
:class:`DocTestParser` defines the following methods:
|
||||
|
||||
|
@ -1438,7 +1381,6 @@ DocTestRunner objects
|
|||
runner compares expected output to actual output, and how it displays failures.
|
||||
For more information, see section :ref:`doctest-options`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
:class:`DocTestParser` defines the following methods:
|
||||
|
||||
|
@ -1530,11 +1472,9 @@ OutputChecker objects
|
|||
if they match; and :meth:`output_difference`, which returns a string describing
|
||||
the differences between two outputs.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
:class:`OutputChecker` defines the following methods:
|
||||
|
||||
|
||||
.. method:: OutputChecker.check_output(want, got, optionflags)
|
||||
|
||||
Return ``True`` iff the actual output from an example (*got*) matches the
|
||||
|
@ -1616,8 +1556,6 @@ Doctest provides several mechanisms for debugging doctest examples:
|
|||
(0, 3)
|
||||
>>>
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The ability to use :func:`pdb.set_trace` usefully inside doctests was added.
|
||||
|
||||
Functions that convert doctests to Python code, and possibly run the synthesized
|
||||
code under the debugger:
|
||||
|
@ -1656,8 +1594,6 @@ code under the debugger:
|
|||
useful when you want to transform an interactive Python session into a Python
|
||||
script.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: testsource(module, name)
|
||||
|
||||
|
@ -1676,8 +1612,6 @@ code under the debugger:
|
|||
prints a script version of function :func:`f`'s docstring, with doctests
|
||||
converted to code, and the rest placed in comments.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: debug(module, name[, pm])
|
||||
|
||||
|
@ -1699,11 +1633,6 @@ code under the debugger:
|
|||
specified, or is false, the script is run under the debugger from the start, via
|
||||
passing an appropriate :func:`exec` call to :func:`pdb.run`.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The *pm* argument was added.
|
||||
|
||||
|
||||
.. function:: debug_src(src[, pm][, globs])
|
||||
|
||||
|
@ -1718,7 +1647,6 @@ code under the debugger:
|
|||
execution context. If not specified, or ``None``, an empty dictionary is used.
|
||||
If specified, a shallow copy of the dictionary is used.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
The :class:`DebugRunner` class, and the special exceptions it may raise, are of
|
||||
most interest to testing framework authors, and will only be sketched here. See
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Brian Quinlan <brianq@activestate.com>
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
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`,
|
||||
|
|
|
@ -43,9 +43,6 @@ The module defines the following:
|
|||
database has to be created. It defaults to octal ``0666`` (and will be modified
|
||||
by the prevailing umask).
|
||||
|
||||
.. versionchanged:: 2.2
|
||||
The *mode* argument was ignored in earlier versions.
|
||||
|
||||
|
||||
.. seealso::
|
||||
|
||||
|
|
|
@ -96,8 +96,6 @@ The :mod:`EasyDialogs` module defines the following functions:
|
|||
chosen, the text of *cmdstr* will be appended to the command line as is, except
|
||||
that a trailing ``':'`` or ``'='`` (if present) will be trimmed off.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. function:: AskFileForOpen( [message] [, typeList] [, defaultLocation] [, defaultOptionFlags] [, location] [, clientName] [, windowTitle] [, actionButtonLabel] [, cancelButtonLabel] [, preferenceKey] [, popupExtension] [, eventProc] [, previewProc] [, filterProc] [, wanted] )
|
||||
|
||||
|
@ -150,9 +148,6 @@ Both determinate (thermometer style) and indeterminate (barber-pole style)
|
|||
progress bars are supported. The bar will be determinate if its maximum value
|
||||
is greater than zero; otherwise it will be indeterminate.
|
||||
|
||||
.. versionchanged:: 2.2
|
||||
Support for indeterminate-style progress bars was added.
|
||||
|
||||
The dialog is displayed immediately after creation. If the dialog's "Cancel"
|
||||
button is pressed, or if :kbd:`Cmd-.` or :kbd:`ESC` is typed, the dialog window
|
||||
is hidden and :exc:`KeyboardInterrupt` is raised (but note that this response
|
||||
|
|
|
@ -13,8 +13,6 @@ Instances of :class:`Charset` are used in several other modules within the
|
|||
|
||||
Import this class from the :mod:`email.charset` module.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. class:: Charset([input_charset])
|
||||
|
||||
|
|
|
@ -66,9 +66,6 @@ object would have a defect, but the containing messages would not.
|
|||
All defect classes are subclassed from :class:`email.errors.MessageDefect`, but
|
||||
this class is *not* an exception!
|
||||
|
||||
.. versionadded:: 2.4
|
||||
All the defect classes were added.
|
||||
|
||||
* :class:`NoBoundaryInMultipartDefect` -- A message claimed to be a multipart,
|
||||
but had no :mimetype:`boundary` parameter.
|
||||
|
||||
|
|
|
@ -61,16 +61,12 @@ The other public :class:`Generator` methods are:
|
|||
|
||||
Note that for subparts, no envelope header is ever printed.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Generator.clone(fp)
|
||||
|
||||
Return an independent clone of this :class:`Generator` instance with the exact
|
||||
same options.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Generator.write(s)
|
||||
|
||||
|
@ -115,9 +111,3 @@ representing the part.
|
|||
The default value for *fmt* is ``None``, meaning ::
|
||||
|
||||
[Non-text (%(type)s) part of message omitted, filename %(filename)s]
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The previously deprecated method :meth:`__call__` was removed.
|
||||
|
||||
|
|
|
@ -43,8 +43,6 @@ the character set that the byte string was encoded in. When the subsequent
|
|||
properly :rfc:`2047` encoded. MIME-aware mail readers would show this header
|
||||
using the embedded ISO-8859-1 character.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
Here is the :class:`Header` class description:
|
||||
|
||||
|
||||
|
|
|
@ -116,9 +116,6 @@ Here are the methods of the :class:`Message` class:
|
|||
responsibility to ensure the payload invariants. Optional *charset* sets the
|
||||
message's default character set; see :meth:`set_charset` for details.
|
||||
|
||||
.. versionchanged:: 2.2.2
|
||||
*charset* argument added.
|
||||
|
||||
|
||||
.. method:: Message.set_charset(charset)
|
||||
|
||||
|
@ -136,15 +133,11 @@ Here are the methods of the :class:`Message` class:
|
|||
:mailheader:`Content-Type`, :mailheader:`Content-Transfer-Encoding`) will be
|
||||
added as needed.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.get_charset()
|
||||
|
||||
Return the :class:`Charset` instance associated with the message's payload.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
The following methods implement a mapping-like interface for accessing the
|
||||
message's :rfc:`2822` headers. Note that there are some semantic differences
|
||||
between these methods and a normal mapping (i.e. dictionary) interface. For
|
||||
|
@ -270,8 +263,6 @@ Here are some additional useful methods:
|
|||
*_name*, retaining header order and field name case. If no matching header was
|
||||
found, a :exc:`KeyError` is raised.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.get_content_type()
|
||||
|
||||
|
@ -288,24 +279,18 @@ Here are some additional useful methods:
|
|||
has an invalid type specification, :rfc:`2045` mandates that the default type be
|
||||
:mimetype:`text/plain`.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.get_content_maintype()
|
||||
|
||||
Return the message's main content type. This is the :mimetype:`maintype` part
|
||||
of the string returned by :meth:`get_content_type`.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.get_content_subtype()
|
||||
|
||||
Return the message's sub-content type. This is the :mimetype:`subtype` part of
|
||||
the string returned by :meth:`get_content_type`.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.get_default_type()
|
||||
|
||||
|
@ -314,8 +299,6 @@ Here are some additional useful methods:
|
|||
:mimetype:`multipart/digest` containers. Such subparts have a default content
|
||||
type of :mimetype:`message/rfc822`.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.set_default_type(ctype)
|
||||
|
||||
|
@ -323,8 +306,6 @@ Here are some additional useful methods:
|
|||
or :mimetype:`message/rfc822`, although this is not enforced. The default
|
||||
content type is not stored in the :mailheader:`Content-Type` header.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.get_params([failobj[, header[, unquote]]])
|
||||
|
||||
|
@ -339,9 +320,6 @@ Here are some additional useful methods:
|
|||
:mailheader:`Content-Type` header. Optional *header* is the header to search
|
||||
instead of :mailheader:`Content-Type`.
|
||||
|
||||
.. versionchanged:: 2.2.2
|
||||
*unquote* argument added.
|
||||
|
||||
|
||||
.. method:: Message.get_param(param[, failobj[, header[, unquote]]])
|
||||
|
||||
|
@ -371,9 +349,6 @@ Here are some additional useful methods:
|
|||
In any case, the parameter value (either the returned string, or the ``VALUE``
|
||||
item in the 3-tuple) is always unquoted, unless *unquote* is set to ``False``.
|
||||
|
||||
.. versionchanged:: 2.2.2
|
||||
*unquote* argument added, and 3-tuple return value possible.
|
||||
|
||||
|
||||
.. method:: Message.set_param(param, value[, header[, requote[, charset[, language]]]])
|
||||
|
||||
|
@ -391,8 +366,6 @@ Here are some additional useful methods:
|
|||
:rfc:`2231`. Optional *language* specifies the RFC 2231 language, defaulting to
|
||||
the empty string. Both *charset* and *language* should be strings.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.del_param(param[, header[, requote]])
|
||||
|
||||
|
@ -402,8 +375,6 @@ Here are some additional useful methods:
|
|||
(the default is ``True``). Optional *header* specifies an alternative to
|
||||
:mailheader:`Content-Type`.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.set_type(type[, header][, requote])
|
||||
|
||||
|
@ -419,8 +390,6 @@ Here are some additional useful methods:
|
|||
:mailheader:`Content-Type` header is set a :mailheader:`MIME-Version` header is
|
||||
also added.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.get_filename([failobj])
|
||||
|
||||
|
@ -464,8 +433,6 @@ Here are some additional useful methods:
|
|||
Note that this method differs from :meth:`get_charset` which returns the
|
||||
:class:`Charset` instance for the default encoding of the message body.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. method:: Message.get_charsets([failobj])
|
||||
|
||||
|
@ -499,10 +466,6 @@ Here are some additional useful methods:
|
|||
text/plain
|
||||
message/rfc822
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The previously deprecated methods :meth:`get_type`, :meth:`get_main_type`, and
|
||||
:meth:`get_subtype` were removed.
|
||||
|
||||
:class:`Message` objects can also optionally contain two instance attributes,
|
||||
which can be used when generating the plain text of a MIME message.
|
||||
|
||||
|
@ -533,7 +496,6 @@ which can be used when generating the plain text of a MIME message.
|
|||
that it contains text that appears between the last boundary and the end of the
|
||||
message.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
You do not need to set the epilogue to the empty string in order for the
|
||||
:class:`Generator` to print a newline at the end of the file.
|
||||
|
||||
|
@ -543,6 +505,3 @@ which can be used when generating the plain text of a MIME message.
|
|||
The *defects* attribute contains a list of all the problems found when parsing
|
||||
this message. See :mod:`email.errors` for a detailed description of the
|
||||
possible parsing defects.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
|
|
@ -49,8 +49,6 @@ Here are the classes:
|
|||
:mimetype:`multipart` messages. If :meth:`attach` is called, a
|
||||
:exc:`MultipartConversionError` exception is raised.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]])
|
||||
|
||||
|
@ -74,8 +72,6 @@ Here are the classes:
|
|||
the keyword arguments, or passed into the *_params* argument, which is a keyword
|
||||
dictionary.
|
||||
|
||||
.. versionadded:: 2.2.2
|
||||
|
||||
|
||||
.. class:: MIMEApplication(_data[, _subtype[, _encoder[, **_params]]])
|
||||
|
||||
|
@ -96,8 +92,6 @@ Here are the classes:
|
|||
|
||||
*_params* are passed straight through to the base class constructor.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. class:: MIMEAudio(_audiodata[, _subtype[, _encoder[, **_params]]])
|
||||
|
||||
|
@ -169,7 +163,3 @@ Here are the classes:
|
|||
:class:`MIMENonMultipart` constructor; it defaults to ``us-ascii``. No guessing
|
||||
or encoding is performed on the text data.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The previously deprecated *_encoding* argument has been removed. Encoding
|
||||
happens implicitly based on the *_charset* argument.
|
||||
|
||||
|
|
|
@ -38,8 +38,6 @@ any way it finds necessary.
|
|||
FeedParser API
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
The :class:`FeedParser`, imported from the :mod:`email.feedparser` module,
|
||||
provides an API that is conducive to incremental parsing of email messages, such
|
||||
as would be necessary when reading the text of an email message from a source
|
||||
|
@ -113,12 +111,6 @@ class.
|
|||
effectively non-strict. You should simply stop passing a *strict* flag to
|
||||
the :class:`Parser` constructor.
|
||||
|
||||
.. versionchanged:: 2.2.2
|
||||
The *strict* flag was added.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The *strict* flag was deprecated.
|
||||
|
||||
The other public :class:`Parser` methods are:
|
||||
|
||||
|
||||
|
@ -136,9 +128,6 @@ The other public :class:`Parser` methods are:
|
|||
|
||||
Optional *headersonly* is as with the :meth:`parse` method.
|
||||
|
||||
.. versionchanged:: 2.2.2
|
||||
The *headersonly* flag was added.
|
||||
|
||||
|
||||
.. method:: Parser.parsestr(text[, headersonly])
|
||||
|
||||
|
@ -150,8 +139,6 @@ The other public :class:`Parser` methods are:
|
|||
reading the headers or not. The default is ``False``, meaning it parses the
|
||||
entire contents of the file.
|
||||
|
||||
.. versionchanged:: 2.2.2
|
||||
The *headersonly* flag was added.
|
||||
|
||||
Since creating a message object structure from a string or a file object is such
|
||||
a common task, two functions are provided as a convenience. They are available
|
||||
|
@ -164,9 +151,6 @@ in the top-level :mod:`email` package namespace.
|
|||
``Parser().parsestr(s)``. Optional *_class* and *strict* are interpreted as
|
||||
with the :class:`Parser` class constructor.
|
||||
|
||||
.. versionchanged:: 2.2.2
|
||||
The *strict* flag was added.
|
||||
|
||||
|
||||
.. function:: message_from_file(fp[, _class[, strict]])
|
||||
|
||||
|
@ -174,9 +158,6 @@ in the top-level :mod:`email` package namespace.
|
|||
exactly equivalent to ``Parser().parse(fp)``. Optional *_class* and *strict*
|
||||
are interpreted as with the :class:`Parser` class constructor.
|
||||
|
||||
.. versionchanged:: 2.2.2
|
||||
The *strict* flag was added.
|
||||
|
||||
Here's an example of how you might use this at an interactive Python prompt::
|
||||
|
||||
>>> import email
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
.. sectionauthor:: Barry A. Warsaw <barry@python.org>
|
||||
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
The :mod:`email` package is a library for managing email messages, including
|
||||
MIME and other :rfc:`2822`\ -based message documents. It subsumes most of the
|
||||
functionality in several older standard modules such as :mod:`rfc822`,
|
||||
|
|
|
@ -104,8 +104,6 @@ There are several useful utilities provided in the :mod:`email.utils` module:
|
|||
needed for some protocols (such as HTTP). This only applies when *localtime* is
|
||||
``False``.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: make_msgid([idstring])
|
||||
|
||||
|
@ -146,17 +144,6 @@ There are several useful utilities provided in the :mod:`email.utils` module:
|
|||
Decode parameters list according to :rfc:`2231`. *params* is a sequence of
|
||||
2-tuples containing elements of the form ``(content-type, string-value)``.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The :func:`dump_address_pair` function has been removed; use :func:`formataddr`
|
||||
instead.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The :func:`decode` function has been removed; use the
|
||||
:meth:`Header.decode_header` method instead.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The :func:`encode` function has been removed; use the :meth:`Header.encode`
|
||||
method instead.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
|
|
|
@ -56,17 +56,12 @@ The following exceptions are only used as base classes for other exceptions.
|
|||
string when there were no arguments. All arguments are stored in :attr:`args`
|
||||
as a tuple.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. exception:: Exception
|
||||
|
||||
All built-in, non-system-exiting exceptions are derived from this class. All
|
||||
user-defined exceptions should also be derived from this class.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Changed to inherit from :exc:`BaseException`.
|
||||
|
||||
|
||||
.. exception:: ArithmeticError
|
||||
|
||||
|
@ -91,8 +86,6 @@ The following exceptions are only used as base classes for other exceptions.
|
|||
:attr:`strerror` attribute (it is usually the associated error message). The
|
||||
tuple itself is also available on the :attr:`args` attribute.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
When an :exc:`EnvironmentError` exception is instantiated with a 3-tuple, the
|
||||
first two items are available as above, while the third item is available on the
|
||||
:attr:`filename` attribute. However, for backwards compatibility, the
|
||||
|
@ -143,11 +136,6 @@ The following exceptions are the exceptions that are actually raised.
|
|||
|
||||
Raise when a generator's :meth:`close` method is called.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
Changed to inherit from Exception instead of StandardError.
|
||||
|
||||
|
||||
.. exception:: IOError
|
||||
|
||||
|
@ -189,9 +177,6 @@ The following exceptions are the exceptions that are actually raised.
|
|||
accidentally caught by code that catches :exc:`Exception` and thus prevent
|
||||
the interpreter from exiting.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Changed to inherit from :exc:`BaseException`.
|
||||
|
||||
|
||||
.. exception:: MemoryError
|
||||
|
||||
|
@ -217,8 +202,6 @@ The following exceptions are the exceptions that are actually raised.
|
|||
classes, abstract methods should raise this exception when they require derived
|
||||
classes to override the method.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
|
||||
.. exception:: OSError
|
||||
|
||||
|
@ -226,10 +209,6 @@ The following exceptions are the exceptions that are actually raised.
|
|||
:mod:`os` module's ``os.error`` exception. See :exc:`EnvironmentError` above for
|
||||
a description of the possible associated values.
|
||||
|
||||
.. % xref for os module
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
|
||||
.. exception:: OverflowError
|
||||
|
||||
|
@ -247,9 +226,6 @@ The following exceptions are the exceptions that are actually raised.
|
|||
after it has been garbage collected. For more information on weak references,
|
||||
see the :mod:`weakref` module.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
Previously known as the :exc:`weakref.ReferenceError` exception.
|
||||
|
||||
|
||||
.. exception:: RuntimeError
|
||||
|
||||
|
@ -264,11 +240,6 @@ The following exceptions are the exceptions that are actually raised.
|
|||
Raised by builtin :func:`next` and an iterator's :meth:`__next__` method to
|
||||
signal that there are no further values.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
Changed to inherit from Exception instead of StandardError.
|
||||
|
||||
|
||||
.. exception:: SyntaxError
|
||||
|
||||
|
@ -320,9 +291,6 @@ The following exceptions are the exceptions that are actually raised.
|
|||
that it is not accidentally caught by code that catches :exc:`Exception`. This
|
||||
allows the exception to properly propagate up and cause the interpreter to exit.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Changed to inherit from :exc:`BaseException`.
|
||||
|
||||
|
||||
.. exception:: TypeError
|
||||
|
||||
|
@ -336,40 +304,30 @@ The following exceptions are the exceptions that are actually raised.
|
|||
no value has been bound to that variable. This is a subclass of
|
||||
:exc:`NameError`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: UnicodeError
|
||||
|
||||
Raised when a Unicode-related encoding or decoding error occurs. It is a
|
||||
subclass of :exc:`ValueError`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: UnicodeEncodeError
|
||||
|
||||
Raised when a Unicode-related error occurs during encoding. It is a subclass of
|
||||
:exc:`UnicodeError`.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. exception:: UnicodeDecodeError
|
||||
|
||||
Raised when a Unicode-related error occurs during decoding. It is a subclass of
|
||||
:exc:`UnicodeError`.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. exception:: UnicodeTranslateError
|
||||
|
||||
Raised when a Unicode-related error occurs during translating. It is a subclass
|
||||
of :exc:`UnicodeError`.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. exception:: ValueError
|
||||
|
||||
|
@ -387,11 +345,6 @@ The following exceptions are the exceptions that are actually raised.
|
|||
Platform API. The :attr:`errno` value maps the :attr:`winerror` value to
|
||||
corresponding ``errno.h`` values. This is a subclass of :exc:`OSError`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Previous versions put the :cfunc:`GetLastError` codes into :attr:`errno`.
|
||||
|
||||
|
||||
.. exception:: ZeroDivisionError
|
||||
|
||||
|
@ -443,15 +396,11 @@ module for more information.
|
|||
|
||||
Base class for warnings about probable mistakes in module imports.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. exception:: UnicodeWarning
|
||||
|
||||
Base class for warnings related to Unicode.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
The class hierarchy for built-in exceptions is:
|
||||
|
||||
|
||||
|
|
|
@ -53,8 +53,6 @@ The following function is the primary interface of this module:
|
|||
during iteration. The parameters to this function will be passed along to the
|
||||
constructor of the :class:`FileInput` class.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added the *mode* and *openhook* parameters.
|
||||
|
||||
The following functions use the global state created by :func:`fileinput.input`;
|
||||
if there is no active state, :exc:`RuntimeError` is raised.
|
||||
|
@ -71,8 +69,6 @@ if there is no active state, :exc:`RuntimeError` is raised.
|
|||
Return the integer "file descriptor" for the current file. When no file is
|
||||
opened (before the first line and between files), returns ``-1``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: lineno()
|
||||
|
||||
|
@ -135,8 +131,6 @@ available for subclassing as well:
|
|||
*filename* and *mode*, and returns an accordingly opened file-like object. You
|
||||
cannot use *inplace* and *openhook* together.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added the *mode* and *openhook* parameters.
|
||||
|
||||
**Optional in-place filtering:** if the keyword argument ``inplace=1`` is passed
|
||||
to :func:`fileinput.input` or to the :class:`FileInput` constructor, the file is
|
||||
|
@ -165,8 +159,6 @@ The two following opening hooks are provided by this module:
|
|||
|
||||
Usage example: ``fi = fileinput.FileInput(openhook=fileinput.hook_compressed)``
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: hook_encoded(encoding)
|
||||
|
||||
|
@ -181,5 +173,3 @@ The two following opening hooks are provided by this module:
|
|||
With this hook, :class:`FileInput` might return Unicode strings depending on the
|
||||
specified *encoding*.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
|
|
@ -65,8 +65,6 @@ patterns.
|
|||
Return the subset of the list of *names* that match *pattern*. It is the same as
|
||||
``[n for n in names if fnmatch(n, pattern)]``, but implemented more efficiently.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: translate(pattern)
|
||||
|
||||
|
|
|
@ -46,9 +46,6 @@ The module defines the following items:
|
|||
specifies a timeout in seconds for the connection attempt (if is not specified,
|
||||
or passed as None, the global default timeout setting will be used).
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
*timeout* was added.
|
||||
|
||||
|
||||
.. data:: all_errors
|
||||
|
||||
|
@ -128,9 +125,6 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
|
|||
is used (the timeout that you passed when instantiating the class); if the
|
||||
object timeout is also None, the global default timeout setting will be used.
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
*timeout* was added.
|
||||
|
||||
|
||||
.. method:: FTP.getwelcome()
|
||||
|
||||
|
@ -203,9 +197,6 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
|
|||
read until EOF using its :meth:`read` method in blocks of size *blocksize* to
|
||||
provide the data to be stored. The *blocksize* argument defaults to 8192.
|
||||
|
||||
.. versionchanged:: 2.1
|
||||
default for *blocksize* added.
|
||||
|
||||
|
||||
.. method:: FTP.storlines(command, file)
|
||||
|
||||
|
|
|
@ -12,8 +12,6 @@ available. They are listed here in alphabetical order.
|
|||
|
||||
.. index::
|
||||
statement: import
|
||||
module: ihooks
|
||||
module: rexec
|
||||
module: imp
|
||||
|
||||
.. note::
|
||||
|
@ -23,9 +21,9 @@ available. They are listed here in alphabetical order.
|
|||
|
||||
The function is invoked by the :keyword:`import` statement. It mainly exists
|
||||
so that you can replace it with another function that has a compatible
|
||||
interface, in order to change the semantics of the :keyword:`import` statement.
|
||||
For examples of why and how you would do this, see the standard library modules
|
||||
:mod:`ihooks` and :mod:`rexec`. See also the built-in module :mod:`imp`, which
|
||||
interface, in order to change the semantics of the :keyword:`import`
|
||||
statement. For examples of why and how you would do this, see the standard
|
||||
library module :mod:`ihooks`. See also the built-in module :mod:`imp`, which
|
||||
defines some useful operations out of which you can build your own
|
||||
:func:`__import__` function.
|
||||
|
||||
|
@ -64,12 +62,6 @@ available. They are listed here in alphabetical order.
|
|||
the number of parent directories to search relative to the directory of the
|
||||
module calling :func:`__import__`.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The level parameter was added.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Keyword support for parameters was added.
|
||||
|
||||
|
||||
.. function:: abs(x)
|
||||
|
||||
|
@ -88,8 +80,6 @@ available. They are listed here in alphabetical order.
|
|||
return False
|
||||
return True
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: any(iterable)
|
||||
|
||||
|
@ -101,8 +91,6 @@ available. They are listed here in alphabetical order.
|
|||
return True
|
||||
return False
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: basestring()
|
||||
|
||||
|
@ -111,8 +99,6 @@ available. They are listed here in alphabetical order.
|
|||
is an instance of :class:`str` (or a user-defined type inherited from
|
||||
:class:`basestring`).
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: bin(x)
|
||||
|
||||
|
@ -120,8 +106,6 @@ available. They are listed here in alphabetical order.
|
|||
expression. If *x* is not a Python :class:`int` object, it has to define an
|
||||
:meth:`__index__` method that returns an integer.
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
|
||||
.. function:: bool([x])
|
||||
|
||||
|
@ -133,11 +117,6 @@ available. They are listed here in alphabetical order.
|
|||
|
||||
.. index:: pair: Boolean; type
|
||||
|
||||
.. versionadded:: 2.2.1
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
If no argument is given, this function returns :const:`False`.
|
||||
|
||||
|
||||
.. function:: bytes([arg[, encoding[, errors]]])
|
||||
|
||||
|
@ -199,11 +178,6 @@ available. They are listed here in alphabetical order.
|
|||
For more information on class methods, consult the documentation on the standard
|
||||
type hierarchy in :ref:`types`.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Function decorator syntax added.
|
||||
|
||||
|
||||
.. function:: cmp(x, y)
|
||||
|
||||
|
@ -340,9 +314,6 @@ available. They are listed here in alphabetical order.
|
|||
*a*, if ``a % b`` is non-zero it has the same sign as *b*, and ``0 <= abs(a % b)
|
||||
< abs(b)``.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
Using :func:`divmod` with complex numbers is deprecated.
|
||||
|
||||
|
||||
.. function:: enumerate(iterable)
|
||||
|
||||
|
@ -360,8 +331,6 @@ available. They are listed here in alphabetical order.
|
|||
2 Fall
|
||||
3 Winter
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: eval(expression[, globals[, locals]])
|
||||
|
||||
|
@ -369,9 +338,6 @@ available. They are listed here in alphabetical order.
|
|||
*globals* must be a dictionary. If provided, *locals* can be any mapping
|
||||
object.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
formerly *locals* was required to be a dictionary.
|
||||
|
||||
The *expression* argument is parsed and evaluated as a Python expression
|
||||
(technically speaking, a condition list) using the *globals* and *locals*
|
||||
dictionaries as global and local name space. If the *globals* dictionary is
|
||||
|
@ -499,8 +465,6 @@ available. They are listed here in alphabetical order.
|
|||
For other containers see the built in :class:`dict`, :class:`list`, and
|
||||
:class:`tuple` classes, and the :mod:`collections` module.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: getattr(object, name[, default])
|
||||
|
||||
|
@ -543,8 +507,6 @@ available. They are listed here in alphabetical order.
|
|||
topic, and a help page is printed on the console. If the argument is any other
|
||||
kind of object, a help page on the object is generated.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: hex(x)
|
||||
|
||||
|
@ -552,9 +514,6 @@ available. They are listed here in alphabetical order.
|
|||
expression. If *x* is not a Python :class:`int` object, it has to define an
|
||||
:meth:`__index__` method that returns an integer.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Formerly only returned an unsigned literal.
|
||||
|
||||
|
||||
.. function:: id(object)
|
||||
|
||||
|
@ -590,9 +549,6 @@ available. They are listed here in alphabetical order.
|
|||
accepted). If *classinfo* is not a type or tuple of types and such tuples,
|
||||
a :exc:`TypeError` exception is raised.
|
||||
|
||||
.. versionchanged:: 2.2
|
||||
Support for a tuple of type information was added.
|
||||
|
||||
|
||||
.. function:: issubclass(class, classinfo)
|
||||
|
||||
|
@ -601,9 +557,6 @@ available. They are listed here in alphabetical order.
|
|||
objects, in which case every entry in *classinfo* will be checked. In any other
|
||||
case, a :exc:`TypeError` exception is raised.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
Support for a tuple of type information was added.
|
||||
|
||||
|
||||
.. function:: iter(o[, sentinel])
|
||||
|
||||
|
@ -618,8 +571,6 @@ available. They are listed here in alphabetical order.
|
|||
its :meth:`__next__` method; if the value returned is equal to *sentinel*,
|
||||
:exc:`StopIteration` will be raised, otherwise the value will be returned.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: len(s)
|
||||
|
||||
|
@ -668,18 +619,14 @@ available. They are listed here in alphabetical order.
|
|||
the result is always a list.
|
||||
|
||||
|
||||
.. function:: max(iterable[, args...][key])
|
||||
.. function:: max(iterable[, args...], *[, key])
|
||||
|
||||
With a single argument *iterable*, return the largest item of a non-empty
|
||||
iterable (such as a string, tuple or list). With more than one argument, return
|
||||
the largest of the arguments.
|
||||
|
||||
The optional *key* argument specifies a one-argument ordering function like that
|
||||
used for :meth:`list.sort`. The *key* argument, if supplied, must be in keyword
|
||||
form (for example, ``max(a,b,c,key=func)``).
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added support for the optional *key* argument.
|
||||
The optional keyword-only *key* argument specifies a one-argument ordering
|
||||
function like that used for :meth:`list.sort`.
|
||||
|
||||
|
||||
.. function:: memoryview(obj)
|
||||
|
@ -689,18 +636,14 @@ available. They are listed here in alphabetical order.
|
|||
XXX: To be documented.
|
||||
|
||||
|
||||
.. function:: min(iterable[, args...][key])
|
||||
.. function:: min(iterable[, args...], *[, key])
|
||||
|
||||
With a single argument *iterable*, return the smallest item of a non-empty
|
||||
iterable (such as a string, tuple or list). With more than one argument, return
|
||||
the smallest of the arguments.
|
||||
|
||||
The optional *key* argument specifies a one-argument ordering function like that
|
||||
used for :meth:`list.sort`. The *key* argument, if supplied, must be in keyword
|
||||
form (for example, ``min(a,b,c,key=func)``).
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added support for the optional *key* argument.
|
||||
The optional keyword-only *key* argument specifies a one-argument ordering
|
||||
function like that used for :meth:`list.sort`.
|
||||
|
||||
|
||||
.. function:: next(iterator[, default])
|
||||
|
@ -713,19 +656,14 @@ available. They are listed here in alphabetical order.
|
|||
.. function:: object()
|
||||
|
||||
Return a new featureless object. :class:`object` is a base for all classes.
|
||||
It has the methods that are common to all instances of Python classes.
|
||||
It has the methods that are common to all instances of Python classes. This
|
||||
function does not accept any arguments.
|
||||
|
||||
.. note::
|
||||
|
||||
:class:`object` does *not* have a :attr:`__dict__`, so you can't assign
|
||||
arbitrary attributes to an instance of the :class:`object` class.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
This function does not accept any arguments. Formerly, it accepted arguments but
|
||||
ignored them.
|
||||
|
||||
|
||||
.. function:: oct(x)
|
||||
|
||||
|
@ -733,9 +671,6 @@ available. They are listed here in alphabetical order.
|
|||
expression. If *x* is not a Python :class:`int` object, it has to define an
|
||||
:meth:`__index__` method that returns an integer.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Formerly only returned an unsigned literal.
|
||||
|
||||
|
||||
.. function:: open(filename[, mode[, bufsize]])
|
||||
|
||||
|
@ -792,9 +727,6 @@ available. They are listed here in alphabetical order.
|
|||
|
||||
See also the :mod:`fileinput` module.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Restriction on first letter of mode string introduced.
|
||||
|
||||
|
||||
.. function:: ord(c)
|
||||
|
||||
|
@ -860,11 +792,6 @@ available. They are listed here in alphabetical order.
|
|||
turns the :meth:`voltage` method into a "getter" for a read-only attribute with
|
||||
the same name.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Use *fget*'s docstring if no *doc* given.
|
||||
|
||||
|
||||
.. function:: range([start,] stop[, step])
|
||||
|
||||
|
@ -909,8 +836,6 @@ available. They are listed here in alphabetical order.
|
|||
protocol (the :meth:`__len__` method and the :meth:`__getitem__` method with
|
||||
integer arguments starting at ``0``).
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: round(x[, n])
|
||||
|
||||
|
@ -930,8 +855,6 @@ available. They are listed here in alphabetical order.
|
|||
For other containers see the built in :class:`dict`, :class:`list`, and
|
||||
:class:`tuple` classes, and the :mod:`collections` module.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: setattr(object, name, value)
|
||||
|
||||
|
@ -980,8 +903,6 @@ available. They are listed here in alphabetical order.
|
|||
multiple times for each list element while *key* and *reverse* touch each
|
||||
element only once.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: staticmethod(function)
|
||||
|
||||
|
@ -1006,11 +927,6 @@ available. They are listed here in alphabetical order.
|
|||
For more information on static methods, consult the documentation on the
|
||||
standard type hierarchy in :ref:`types`.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Function decorator syntax added.
|
||||
|
||||
|
||||
.. function:: str([object[, encoding[, errors]]])
|
||||
|
||||
|
@ -1051,8 +967,6 @@ available. They are listed here in alphabetical order.
|
|||
and are not allowed to be strings. The fast, correct way to concatenate a
|
||||
sequence of strings is by calling ``''.join(sequence)``.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: super(type[, object-or-type])
|
||||
|
||||
|
@ -1074,8 +988,6 @@ available. They are listed here in alphabetical order.
|
|||
Accordingly, :func:`super` is undefined for implicit lookups using statements or
|
||||
operators such as ``super(C, self)[name]``.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: tuple([iterable])
|
||||
|
||||
|
@ -1121,8 +1033,6 @@ available. They are listed here in alphabetical order.
|
|||
...
|
||||
>>> X = type('X', (object,), dict(a=1))
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: vars([object])
|
||||
|
||||
|
@ -1143,11 +1053,6 @@ available. They are listed here in alphabetical order.
|
|||
sequence argument, it returns a list of 1-tuples. With no arguments, it returns
|
||||
an empty list.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Formerly, :func:`zip` required at least one argument and ``zip()`` raised a
|
||||
:exc:`TypeError` instead of returning an empty list.
|
||||
|
||||
.. % ---------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
.. sectionauthor:: Peter Harris <scav@blueyonder.co.uk>
|
||||
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
The :mod:`functools` module is for higher-order functions: functions that act on
|
||||
or return other functions. In general, any callable object can be treated as a
|
||||
function for the purposes of this module.
|
||||
|
@ -23,8 +21,6 @@ The :mod:`functools` module defines the following functions:
|
|||
This is the same function as :func:`reduce`. It is made available in this module
|
||||
to allow writing code more forward-compatible with Python 3.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
|
||||
.. function:: partial(func[,*args][, **keywords])
|
||||
|
||||
|
|
|
@ -44,9 +44,6 @@ The :mod:`gc` module provides the following functions:
|
|||
:exc:`ValueError` is raised if the generation number is invalid. The number of
|
||||
unreachable objects found is returned.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The optional *generation* argument was added.
|
||||
|
||||
|
||||
.. function:: set_debug(flags)
|
||||
|
||||
|
@ -65,8 +62,6 @@ The :mod:`gc` module provides the following functions:
|
|||
Returns a list of all objects tracked by the collector, excluding the list
|
||||
returned.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: set_threshold(threshold0[, threshold1[, threshold2]])
|
||||
|
||||
|
@ -93,8 +88,6 @@ The :mod:`gc` module provides the following functions:
|
|||
Return the current collection counts as a tuple of ``(count0, count1,
|
||||
count2)``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: get_threshold()
|
||||
|
||||
|
@ -119,8 +112,6 @@ The :mod:`gc` module provides the following functions:
|
|||
invalid state. Avoid using :func:`get_referrers` for any purpose other than
|
||||
debugging.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: get_referents(*objs)
|
||||
|
||||
|
@ -132,12 +123,10 @@ The :mod:`gc` module provides the following functions:
|
|||
be involved in a cycle. So, for example, if an integer is directly reachable
|
||||
from an argument, that integer object may or may not appear in the result list.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
The following variable is provided for read-only access (you can mutate its
|
||||
value but should not rebind it):
|
||||
|
||||
|
||||
.. data:: garbage
|
||||
|
||||
A list of objects which the collector found to be unreachable but could not be
|
||||
|
|
|
@ -61,8 +61,6 @@ exception:
|
|||
variable POSIXLY_CORRECT is set, then option processing stops as soon as a
|
||||
non-option argument is encountered.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. exception:: GetoptError
|
||||
|
||||
|
@ -74,10 +72,7 @@ exception:
|
|||
related option; if there is no specific option to which the exception relates,
|
||||
:attr:`opt` is an empty string.
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
Introduced :exc:`GetoptError` as a synonym for :exc:`error`.
|
||||
|
||||
|
||||
.. XXX deprecated?
|
||||
.. exception:: error
|
||||
|
||||
Alias for :exc:`GetoptError`; for backward compatibility.
|
||||
|
|
|
@ -22,9 +22,6 @@ The :mod:`getpass` module provides two functions:
|
|||
|
||||
Availability: Macintosh, Unix, Windows.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The *stream* parameter was added.
|
||||
|
||||
|
||||
.. function:: getuser()
|
||||
|
||||
|
|
|
@ -49,8 +49,6 @@ class-based API instead.
|
|||
:func:`gettext` family of functions. If *codeset* is omitted, then the current
|
||||
binding is returned.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: textdomain([domain])
|
||||
|
||||
|
@ -72,8 +70,6 @@ class-based API instead.
|
|||
system encoding, if no other encoding was explicitly set with
|
||||
:func:`bind_textdomain_codeset`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: dgettext(domain, message)
|
||||
|
||||
|
@ -86,8 +82,6 @@ class-based API instead.
|
|||
system encoding, if no other encoding was explicitly set with
|
||||
:func:`bind_textdomain_codeset`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: ngettext(singular, plural, n)
|
||||
|
||||
|
@ -102,8 +96,6 @@ class-based API instead.
|
|||
syntax to be used in :file:`.po` files and the formulas for a variety of
|
||||
languages.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: lngettext(singular, plural, n)
|
||||
|
||||
|
@ -111,15 +103,11 @@ class-based API instead.
|
|||
system encoding, if no other encoding was explicitly set with
|
||||
:func:`bind_textdomain_codeset`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: dngettext(domain, singular, plural, n)
|
||||
|
||||
Like :func:`ngettext`, but look the message up in the specified *domain*.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: ldngettext(domain, singular, plural, n)
|
||||
|
||||
|
@ -127,7 +115,6 @@ class-based API instead.
|
|||
preferred system encoding, if no other encoding was explicitly set with
|
||||
:func:`bind_textdomain_codeset`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
Note that GNU :program:`gettext` also defines a :func:`dcgettext` method, but
|
||||
this was deemed not useful and so it is currently unimplemented.
|
||||
|
@ -199,9 +186,6 @@ the built-in namespace as the function :func:`_`.
|
|||
*fallback* is false (which is the default), and returns a
|
||||
:class:`NullTranslations` instance if *fallback* is true.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Added the *codeset* parameter.
|
||||
|
||||
|
||||
.. function:: install(domain[, localedir[, unicode [, codeset[, names]]]])
|
||||
|
||||
|
@ -223,12 +207,6 @@ the built-in namespace as the function :func:`_`.
|
|||
builtin namespace, so it is easily accessible in all modules of your
|
||||
application.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Added the *codeset* parameter.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added the *names* parameter.
|
||||
|
||||
|
||||
The :class:`NullTranslations` class
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -275,8 +253,6 @@ are the methods of :class:`NullTranslations`:
|
|||
If a fallback has been set, forward :meth:`lgettext` to the fallback. Otherwise,
|
||||
return the translated message. Overridden in derived classes.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: NullTranslations.ugettext(message)
|
||||
|
||||
|
@ -290,16 +266,12 @@ are the methods of :class:`NullTranslations`:
|
|||
If a fallback has been set, forward :meth:`ngettext` to the fallback. Otherwise,
|
||||
return the translated message. Overridden in derived classes.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: NullTranslations.lngettext(singular, plural, n)
|
||||
|
||||
If a fallback has been set, forward :meth:`ngettext` to the fallback. Otherwise,
|
||||
return the translated message. Overridden in derived classes.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: NullTranslations.ungettext(singular, plural, n)
|
||||
|
||||
|
@ -307,8 +279,6 @@ are the methods of :class:`NullTranslations`:
|
|||
Otherwise, return the translated message as a Unicode string. Overridden in
|
||||
derived classes.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: NullTranslations.info()
|
||||
|
||||
|
@ -325,16 +295,12 @@ are the methods of :class:`NullTranslations`:
|
|||
Return the "protected" :attr:`_output_charset` variable, which defines the
|
||||
encoding used to return translated messages.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: NullTranslations.set_output_charset(charset)
|
||||
|
||||
Change the "protected" :attr:`_output_charset` variable, which defines the
|
||||
encoding used to return translated messages.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: NullTranslations.install([unicode [, names]])
|
||||
|
||||
|
@ -362,9 +328,6 @@ are the methods of :class:`NullTranslations`:
|
|||
This puts :func:`_` only in the module's global namespace and so only affects
|
||||
calls within this module.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added the *names* parameter.
|
||||
|
||||
|
||||
The :class:`GNUTranslations` class
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -415,8 +378,6 @@ The following methods are overridden from the base class implementation:
|
|||
system encoding, if no other encoding was explicitly set with
|
||||
:meth:`set_output_charset`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: GNUTranslations.ugettext(message)
|
||||
|
||||
|
@ -437,8 +398,6 @@ The following methods are overridden from the base class implementation:
|
|||
request is forwarded to the fallback's :meth:`ngettext` method. Otherwise, when
|
||||
*n* is 1 *singular* is returned, and *plural* is returned in all other cases.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: GNUTranslations.lngettext(singular, plural, n)
|
||||
|
||||
|
@ -446,8 +405,6 @@ The following methods are overridden from the base class implementation:
|
|||
system encoding, if no other encoding was explicitly set with
|
||||
:meth:`set_output_charset`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: GNUTranslations.ungettext(singular, plural, n)
|
||||
|
||||
|
@ -469,8 +426,6 @@ The following methods are overridden from the base class implementation:
|
|||
'There are %(num)d files in this directory',
|
||||
n) % {'num': n}
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
Solaris message catalog support
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -31,7 +31,6 @@ subshell. (For tilde and shell variable expansion, use
|
|||
Return an iterator which yields the same values as :func:`glob` without actually
|
||||
storing them all simultaneously.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
For example, consider a directory containing only the following files:
|
||||
:file:`1.gif`, :file:`2.txt`, and :file:`card.gif`. :func:`glob` will produce
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Gregory P. Smith <greg@users.sourceforge.net>
|
||||
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
.. index::
|
||||
single: message digest, MD5
|
||||
single: secure hash algorithm, SHA1, SHA224, SHA256, SHA384, SHA512
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
|
||||
.. % Theoretical explanation:
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
This module provides an implementation of the heap queue algorithm, also known
|
||||
as the priority queue algorithm.
|
||||
|
||||
|
@ -99,8 +97,6 @@ The module also offers three general purpose functions based on heaps.
|
|||
not pull the data into memory all at once, and assumes that each of the input
|
||||
streams is already sorted (smallest to largest).
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
|
||||
.. function:: nlargest(n, iterable[, key])
|
||||
|
||||
|
@ -110,11 +106,6 @@ The module also offers three general purpose functions based on heaps.
|
|||
``key=str.lower`` Equivalent to: ``sorted(iterable, key=key,
|
||||
reverse=True)[:n]``
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added the optional *key* argument.
|
||||
|
||||
|
||||
.. function:: nsmallest(n, iterable[, key])
|
||||
|
||||
|
@ -123,10 +114,6 @@ The module also offers three general purpose functions based on heaps.
|
|||
used to extract a comparison key from each element in the iterable:
|
||||
``key=str.lower`` Equivalent to: ``sorted(iterable, key=key)[:n]``
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added the optional *key* argument.
|
||||
|
||||
The latter two functions perform best for smaller values of *n*. For larger
|
||||
values, it is more efficient to use the :func:`sorted` function. Also, when
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Gerhard Häring <ghaering@users.sourceforge.net>
|
||||
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
This module implements the HMAC algorithm as described by :rfc:`2104`.
|
||||
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Anthony Baxter <anthony@interlink.com.au>
|
||||
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
This module provides a nicer interface to the :mod:`_hotshot` C module. Hotshot
|
||||
is a replacement for the existing :mod:`profile` module. As it's written mostly
|
||||
in C, it should result in a much smaller performance impact than the existing
|
||||
|
@ -22,10 +20,6 @@ in C, it should result in a much smaller performance impact than the existing
|
|||
recommended to use :mod:`cProfile` instead. :mod:`hotshot` is not maintained and
|
||||
might be removed from the standard library in the future.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
the results should be more meaningful than in the past: the timing core
|
||||
contained a critical bug.
|
||||
|
||||
.. warning::
|
||||
|
||||
The :mod:`hotshot` profiler does not yet work well with threads. It is useful to
|
||||
|
@ -104,8 +98,6 @@ Using hotshot data
|
|||
:synopsis: Statistical analysis for Hotshot
|
||||
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
This module loads hotshot profiling data into the standard :mod:`pstats` Stats
|
||||
objects.
|
||||
|
||||
|
|
|
@ -68,8 +68,6 @@ The module defines a parser class and an exception:
|
|||
Exception raised by the :class:`HTMLParser` class when it encounters an error
|
||||
while parsing.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. seealso::
|
||||
|
||||
|
@ -175,12 +173,8 @@ can be handled using simple textual substitution in the Latin-1 character set
|
|||
|
||||
A dictionary that maps HTML entity names to the Unicode codepoints.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: codepoint2name
|
||||
|
||||
A dictionary that maps Unicode codepoints to HTML entity names.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
|
|
@ -6,11 +6,7 @@
|
|||
:synopsis: A simple parser that can handle HTML and XHTML.
|
||||
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
.. index::
|
||||
single: HTML
|
||||
single: XHTML
|
||||
.. index:: HTML, XHTML
|
||||
|
||||
This module defines a class :class:`HTMLParser` which serves as the basis for
|
||||
parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML.
|
||||
|
@ -91,8 +87,7 @@ An exception is defined as well:
|
|||
HREF="http://www.cwi.nl/">``, this method would be called as
|
||||
``handle_starttag('a', [('href', 'http://www.cwi.nl/')])``.
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
All entity references from htmlentitydefs are now replaced in the attribute
|
||||
All entity references from htmlentitydefs are replaced in the attribute
|
||||
values.
|
||||
|
||||
|
||||
|
|
|
@ -44,11 +44,6 @@ The module provides the following classes:
|
|||
>>> h3 = httplib.HTTPConnection('www.cwi.nl', 80)
|
||||
>>> h3 = httplib.HTTPConnection('www.cwi.nl', 80, timeout=10)
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
*timeout* was added.
|
||||
|
||||
|
||||
.. class:: HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout]]]]])
|
||||
|
||||
|
@ -61,18 +56,12 @@ The module provides the following classes:
|
|||
|
||||
This does not do any certificate verification!
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
*timeout* was added.
|
||||
|
||||
|
||||
.. class:: HTTPResponse(sock[, debuglevel=0][, strict=0])
|
||||
|
||||
Class whose instances are returned upon successful connection. Not instantiated
|
||||
directly by user.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
The following exceptions are raised as appropriate:
|
||||
|
||||
|
@ -82,87 +71,63 @@ The following exceptions are raised as appropriate:
|
|||
The base class of the other exceptions in this module. It is a subclass of
|
||||
:exc:`Exception`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: NotConnected
|
||||
|
||||
A subclass of :exc:`HTTPException`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: InvalidURL
|
||||
|
||||
A subclass of :exc:`HTTPException`, raised if a port is given and is either
|
||||
non-numeric or empty.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. exception:: UnknownProtocol
|
||||
|
||||
A subclass of :exc:`HTTPException`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: UnknownTransferEncoding
|
||||
|
||||
A subclass of :exc:`HTTPException`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: UnimplementedFileMode
|
||||
|
||||
A subclass of :exc:`HTTPException`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: IncompleteRead
|
||||
|
||||
A subclass of :exc:`HTTPException`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: ImproperConnectionState
|
||||
|
||||
A subclass of :exc:`HTTPException`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: CannotSendRequest
|
||||
|
||||
A subclass of :exc:`ImproperConnectionState`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: CannotSendHeader
|
||||
|
||||
A subclass of :exc:`ImproperConnectionState`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: ResponseNotReady
|
||||
|
||||
A subclass of :exc:`ImproperConnectionState`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. exception:: BadStatusLine
|
||||
|
||||
A subclass of :exc:`HTTPException`. Raised if a server responds with a HTTP
|
||||
status code that we don't understand.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
The constants defined in this module are:
|
||||
|
||||
|
||||
|
@ -375,8 +340,6 @@ and also the following constants for integer status codes:
|
|||
|
||||
Example: ``httplib.responses[httplib.NOT_FOUND]`` is ``'Not Found'``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. _httpconnection-objects:
|
||||
|
||||
|
@ -396,9 +359,6 @@ HTTPConnection Objects
|
|||
Content-Length is automatically set to the correct value. The *headers*
|
||||
argument should be a mapping of extra HTTP headers to send with the request.
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
*body* can be a file object.
|
||||
|
||||
|
||||
.. method:: HTTPConnection.getresponse()
|
||||
|
||||
|
@ -439,9 +399,6 @@ also send your request step by step, by using the four functions below.
|
|||
content encodings), specify *skip_host* or *skip_accept_encoding* with non-False
|
||||
values.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
*skip_accept_encoding* argument added.
|
||||
|
||||
|
||||
.. method:: HTTPConnection.putheader(header, argument[, ...])
|
||||
|
||||
|
@ -486,8 +443,6 @@ HTTPResponse Objects
|
|||
|
||||
Return a list of (header, value) tuples.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. attribute:: HTTPResponse.msg
|
||||
|
||||
|
|
|
@ -82,7 +82,6 @@ The second subclass allows for connections created by a child process:
|
|||
``stdin/stdout`` file descriptors created by passing *command* to
|
||||
``os.popen2()``.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
The following utility functions are defined:
|
||||
|
||||
|
@ -207,8 +206,6 @@ An :class:`IMAP4` instance has the following methods:
|
|||
|
||||
Delete the ACLs (remove any rights) set for who on mailbox.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: IMAP4.expunge()
|
||||
|
||||
|
@ -235,24 +232,18 @@ An :class:`IMAP4` instance has the following methods:
|
|||
Retrieve the specified ``ANNOTATION``\ s for *mailbox*. The method is
|
||||
non-standard, but is supported by the ``Cyrus`` server.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. method:: IMAP4.getquota(root)
|
||||
|
||||
Get the ``quota`` *root*'s resource usage and limits. This method is part of the
|
||||
IMAP4 QUOTA extension defined in rfc2087.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: IMAP4.getquotaroot(mailbox)
|
||||
|
||||
Get the list of ``quota`` ``roots`` for the named *mailbox*. This method is part
|
||||
of the IMAP4 QUOTA extension defined in rfc2087.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: IMAP4.list([directory[, pattern]])
|
||||
|
||||
|
@ -272,8 +263,6 @@ An :class:`IMAP4` instance has the following methods:
|
|||
the password. Will only work if the server ``CAPABILITY`` response includes the
|
||||
phrase ``AUTH=CRAM-MD5``.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: IMAP4.logout()
|
||||
|
||||
|
@ -291,15 +280,11 @@ An :class:`IMAP4` instance has the following methods:
|
|||
|
||||
Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: IMAP4.namespace()
|
||||
|
||||
Returns IMAP namespaces as defined in RFC2342.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: IMAP4.noop()
|
||||
|
||||
|
@ -324,8 +309,6 @@ An :class:`IMAP4` instance has the following methods:
|
|||
Assume authentication as *user*. Allows an authorised administrator to proxy
|
||||
into any user's mailbox.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: IMAP4.read(size)
|
||||
|
||||
|
@ -393,16 +376,12 @@ An :class:`IMAP4` instance has the following methods:
|
|||
Set ``ANNOTATION``\ s for *mailbox*. The method is non-standard, but is
|
||||
supported by the ``Cyrus`` server.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. method:: IMAP4.setquota(root, limits)
|
||||
|
||||
Set the ``quota`` *root*'s resource *limits*. This method is part of the IMAP4
|
||||
QUOTA extension defined in rfc2087.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: IMAP4.shutdown()
|
||||
|
||||
|
@ -476,8 +455,6 @@ An :class:`IMAP4` instance has the following methods:
|
|||
|
||||
This is an ``IMAP4rev1`` extension command.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: IMAP4.uid(command, arg[, ...])
|
||||
|
||||
|
|
|
@ -47,9 +47,6 @@ from :func:`what`:
|
|||
| ``'png'`` | Portable Network Graphics |
|
||||
+------------+-----------------------------------+
|
||||
|
||||
.. versionadded:: 2.5
|
||||
Exif detection.
|
||||
|
||||
You can extend the list of file types :mod:`imghdr` can recognize by appending
|
||||
to this variable:
|
||||
|
||||
|
|
|
@ -116,15 +116,12 @@ This module provides an interface to the mechanisms used to implement the
|
|||
be used by import hooks to ensure thread-safety when importing modules. On
|
||||
platforms without threads, this function does nothing.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: release_lock()
|
||||
|
||||
Release the interpreter's import lock. On platforms without threads, this
|
||||
function does nothing.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
The following constants with integer values, defined in this module, are used to
|
||||
indicate the search result of :func:`find_module`.
|
||||
|
@ -265,8 +262,6 @@ around for backward compatibility:
|
|||
This method always returns ``None``, indicating that the requested module could
|
||||
not be found.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. _examples-imp:
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
:mod:`imputil` --- Import utilities
|
||||
=====================================================
|
||||
===================================
|
||||
|
||||
.. module:: imputil
|
||||
:synopsis: Manage and augment the import process.
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Ka-Ping Yee <ping@lfw.org>
|
||||
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
The :mod:`inspect` module provides several useful functions to help get
|
||||
information about live objects such as modules, classes, methods, functions,
|
||||
tracebacks, frame objects, and code objects. For example, it can help you
|
||||
|
@ -33,156 +31,150 @@ provided as convenient choices for the second argument to :func:`getmembers`.
|
|||
They also help you determine when you can expect to find the following special
|
||||
attributes:
|
||||
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| Type | Attribute | Description | Notes |
|
||||
+===========+=================+===========================+=======+
|
||||
| module | __doc__ | documentation string | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | __file__ | filename (missing for | |
|
||||
| | | built-in modules) | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| class | __doc__ | documentation string | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | __module__ | name of module in which | |
|
||||
| | | this class was defined | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| method | __doc__ | documentation string | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | __name__ | name with which this | |
|
||||
| | | method was defined | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | im_class | class object that asked | \(1) |
|
||||
| | | for this method | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | im_func | function object | |
|
||||
| | | containing implementation | |
|
||||
| | | of method | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | im_self | instance to which this | |
|
||||
| | | method is bound, or | |
|
||||
| | | ``None`` | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| function | __doc__ | documentation string | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | __name__ | name with which this | |
|
||||
| | | function was defined | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | __code__ | code object containing | |
|
||||
| | | compiled function | |
|
||||
| | | bytecode | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | __defaults__ | tuple of any default | |
|
||||
| | | values for arguments | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | __globals__ | global namespace in which | |
|
||||
| | | this function was defined | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| traceback | tb_frame | frame object at this | |
|
||||
| | | level | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | tb_lasti | index of last attempted | |
|
||||
| | | instruction in bytecode | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | tb_lineno | current line number in | |
|
||||
| | | Python source code | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | tb_next | next inner traceback | |
|
||||
| | | object (called by this | |
|
||||
| | | level) | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| frame | f_back | next outer frame object | |
|
||||
| | | (this frame's caller) | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_builtins | built-in namespace seen | |
|
||||
| | | by this frame | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_code | code object being | |
|
||||
| | | executed in this frame | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_exc_traceback | traceback if raised in | |
|
||||
| | | this frame, or ``None`` | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_exc_type | exception type if raised | |
|
||||
| | | in this frame, or | |
|
||||
| | | ``None`` | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_exc_value | exception value if raised | |
|
||||
| | | in this frame, or | |
|
||||
| | | ``None`` | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_globals | global namespace seen by | |
|
||||
| | | this frame | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_lasti | index of last attempted | |
|
||||
| | | instruction in bytecode | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_lineno | current line number in | |
|
||||
| | | Python source code | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_locals | local namespace seen by | |
|
||||
| | | this frame | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_restricted | 0 or 1 if frame is in | |
|
||||
| | | restricted execution mode | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | f_trace | tracing function for this | |
|
||||
| | | frame, or ``None`` | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| code | co_argcount | number of arguments (not | |
|
||||
| | | including \* or \*\* | |
|
||||
| | | args) | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_code | string of raw compiled | |
|
||||
| | | bytecode | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_consts | tuple of constants used | |
|
||||
| | | in the bytecode | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_filename | name of file in which | |
|
||||
| | | this code object was | |
|
||||
| | | created | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_firstlineno | number of first line in | |
|
||||
| | | Python source code | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_flags | bitmap: 1=optimized ``|`` | |
|
||||
| | | 2=newlocals ``|`` 4=\*arg | |
|
||||
| | | ``|`` 8=\*\*arg | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_lnotab | encoded mapping of line | |
|
||||
| | | numbers to bytecode | |
|
||||
| | | indices | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_name | name with which this code | |
|
||||
| | | object was defined | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_names | tuple of names of local | |
|
||||
| | | variables | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_nlocals | number of local variables | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_stacksize | virtual machine stack | |
|
||||
| | | space required | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | co_varnames | tuple of names of | |
|
||||
| | | arguments and local | |
|
||||
| | | variables | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| builtin | __doc__ | documentation string | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | __name__ | original name of this | |
|
||||
| | | function or method | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
| | __self__ | instance to which a | |
|
||||
| | | method is bound, or | |
|
||||
| | | ``None`` | |
|
||||
+-----------+-----------------+---------------------------+-------+
|
||||
|
||||
Note:
|
||||
|
||||
(1)
|
||||
.. versionchanged:: 2.2
|
||||
:attr:`im_class` used to refer to the class that defined the method.
|
||||
+-----------+-----------------+---------------------------+
|
||||
| Type | Attribute | Description |
|
||||
+===========+=================+===========================+
|
||||
| module | __doc__ | documentation string |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | __file__ | filename (missing for |
|
||||
| | | built-in modules) |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| class | __doc__ | documentation string |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | __module__ | name of module in which |
|
||||
| | | this class was defined |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| method | __doc__ | documentation string |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | __name__ | name with which this |
|
||||
| | | method was defined |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | im_class | class object that asked |
|
||||
| | | for this method |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | im_func | function object |
|
||||
| | | containing implementation |
|
||||
| | | of method |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | im_self | instance to which this |
|
||||
| | | method is bound, or |
|
||||
| | | ``None`` |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| function | __doc__ | documentation string |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | __name__ | name with which this |
|
||||
| | | function was defined |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | __code__ | code object containing |
|
||||
| | | compiled function |
|
||||
| | | bytecode |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | __defaults__ | tuple of any default |
|
||||
| | | values for arguments |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | __globals__ | global namespace in which |
|
||||
| | | this function was defined |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| traceback | tb_frame | frame object at this |
|
||||
| | | level |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | tb_lasti | index of last attempted |
|
||||
| | | instruction in bytecode |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | tb_lineno | current line number in |
|
||||
| | | Python source code |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | tb_next | next inner traceback |
|
||||
| | | object (called by this |
|
||||
| | | level) |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| frame | f_back | next outer frame object |
|
||||
| | | (this frame's caller) |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_builtins | built-in namespace seen |
|
||||
| | | by this frame |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_code | code object being |
|
||||
| | | executed in this frame |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_exc_traceback | traceback if raised in |
|
||||
| | | this frame, or ``None`` |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_exc_type | exception type if raised |
|
||||
| | | in this frame, or |
|
||||
| | | ``None`` |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_exc_value | exception value if raised |
|
||||
| | | in this frame, or |
|
||||
| | | ``None`` |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_globals | global namespace seen by |
|
||||
| | | this frame |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_lasti | index of last attempted |
|
||||
| | | instruction in bytecode |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_lineno | current line number in |
|
||||
| | | Python source code |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_locals | local namespace seen by |
|
||||
| | | this frame |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_restricted | 0 or 1 if frame is in |
|
||||
| | | restricted execution mode |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | f_trace | tracing function for this |
|
||||
| | | frame, or ``None`` |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| code | co_argcount | number of arguments (not |
|
||||
| | | including \* or \*\* |
|
||||
| | | args) |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_code | string of raw compiled |
|
||||
| | | bytecode |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_consts | tuple of constants used |
|
||||
| | | in the bytecode |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_filename | name of file in which |
|
||||
| | | this code object was |
|
||||
| | | created |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_firstlineno | number of first line in |
|
||||
| | | Python source code |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_flags | bitmap: 1=optimized ``|`` |
|
||||
| | | 2=newlocals ``|`` 4=\*arg |
|
||||
| | | ``|`` 8=\*\*arg |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_lnotab | encoded mapping of line |
|
||||
| | | numbers to bytecode |
|
||||
| | | indices |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_name | name with which this code |
|
||||
| | | object was defined |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_names | tuple of names of local |
|
||||
| | | variables |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_nlocals | number of local variables |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_stacksize | virtual machine stack |
|
||||
| | | space required |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | co_varnames | tuple of names of |
|
||||
| | | arguments and local |
|
||||
| | | variables |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| builtin | __doc__ | documentation string |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | __name__ | original name of this |
|
||||
| | | function or method |
|
||||
+-----------+-----------------+---------------------------+
|
||||
| | __self__ | instance to which a |
|
||||
| | | method is bound, or |
|
||||
| | | ``None`` |
|
||||
+-----------+-----------------+---------------------------+
|
||||
|
||||
|
||||
.. function:: getmembers(object[, predicate])
|
||||
|
@ -286,8 +278,6 @@ Note:
|
|||
have __name__ and __doc__ attributes (properties, getsets, and members have both
|
||||
of these attributes), but this is not guaranteed.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: isgetsetdescriptor(object)
|
||||
|
||||
|
@ -297,8 +287,6 @@ Note:
|
|||
structures. For Python implementations without such types, this method will
|
||||
always return ``False``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: ismemberdescriptor(object)
|
||||
|
||||
|
@ -308,8 +296,6 @@ Note:
|
|||
``PyMemberDef`` structures. For Python implementations without such types, this
|
||||
method will always return ``False``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. _inspect-source:
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Raymond Hettinger <python@rcn.com>
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
This module implements a number of iterator building blocks inspired by
|
||||
constructs from the Haskell and SML programming languages. Each has been recast
|
||||
in a form suitable for Python.
|
||||
|
@ -178,8 +176,6 @@ loops that truncate the stream.
|
|||
self.currvalue = next(self.it) # Exit on StopIteration
|
||||
self.currkey = self.keyfunc(self.currvalue)
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: ifilter(predicate, iterable)
|
||||
|
||||
|
@ -253,9 +249,6 @@ loops that truncate the stream.
|
|||
If *start* is ``None``, then iteration starts at zero. If *step* is ``None``,
|
||||
then the step defaults to one.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
accept ``None`` values for default *start* and *step*.
|
||||
|
||||
|
||||
.. function:: izip(*iterables)
|
||||
|
||||
|
@ -269,9 +262,7 @@ loops that truncate the stream.
|
|||
result = [next(it) for it in iterables]
|
||||
yield tuple(result)
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
When no iterables are specified, returns a zero length iterator instead of
|
||||
raising a :exc:`TypeError` exception.
|
||||
When no iterables are specified, return a zero length iterator.
|
||||
|
||||
Note, the left-to-right evaluation order of the iterables is guaranteed. This
|
||||
makes possible an idiom for clustering a data series into n-length groups using
|
||||
|
@ -313,8 +304,6 @@ loops that truncate the stream.
|
|||
function should be wrapped with something that limits the number of calls (for
|
||||
example :func:`islice` or :func:`takewhile`).
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
|
||||
.. function:: repeat(object[, times])
|
||||
|
||||
|
@ -385,8 +374,6 @@ loops that truncate the stream.
|
|||
iterator is going to use most or all of the data before the other iterator, it
|
||||
is faster to use :func:`list` instead of :func:`tee`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. _itertools-example:
|
||||
|
||||
|
|
|
@ -28,9 +28,6 @@ The :mod:`linecache` module defines the following functions:
|
|||
``__loader__`` in *module_globals*, in case the module was imported from a
|
||||
zipfile or other non-filesystem import source.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
The *module_globals* parameter was added.
|
||||
|
||||
|
||||
.. function:: clearcache()
|
||||
|
||||
|
|
|
@ -50,9 +50,6 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
specified in the :envvar:`LANG` environment variable). If the locale is not
|
||||
changed thereafter, using multithreading should not cause problems.
|
||||
|
||||
.. versionchanged:: 2.0
|
||||
Added support for tuple values of the *locale* parameter.
|
||||
|
||||
|
||||
.. function:: localeconv()
|
||||
|
||||
|
@ -176,8 +173,6 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
*language code* and *encoding* may be ``None`` if their values cannot be
|
||||
determined.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. function:: getlocale([category])
|
||||
|
||||
|
@ -189,8 +184,6 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
*language code* and *encoding* may be ``None`` if their values cannot be
|
||||
determined.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. function:: getpreferredencoding([do_setlocale])
|
||||
|
||||
|
@ -203,8 +196,6 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
preferences, so this function is not thread-safe. If invoking setlocale is not
|
||||
necessary or desired, *do_setlocale* should be set to ``False``.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: normalize(localename)
|
||||
|
||||
|
@ -215,8 +206,6 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
If the given encoding is not known, the function defaults to the default
|
||||
encoding for the locale code just like :func:`setlocale`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. function:: resetlocale([category])
|
||||
|
||||
|
@ -225,8 +214,6 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
The default setting is determined by calling :func:`getdefaultlocale`.
|
||||
*category* defaults to :const:`LC_ALL`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. function:: strcoll(string1, string2)
|
||||
|
||||
|
@ -259,17 +246,12 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
Please note that this function will only work for exactly one %char specifier.
|
||||
For whole format strings, use :func:`format_string`.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added the *monetary* parameter.
|
||||
|
||||
|
||||
.. function:: format_string(format, val[, grouping])
|
||||
|
||||
Processes formatting specifiers as in ``format % val``, but takes the current
|
||||
locale settings into account.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: currency(val[, symbol[, grouping[, international]]])
|
||||
|
||||
|
@ -283,8 +265,6 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
Note that this function will not work with the 'C' locale, so you have to set a
|
||||
locale via :func:`setlocale` first.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: str(float)
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
|
||||
.. index:: pair: Errors; logging
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
This module defines functions and classes which implement a flexible error
|
||||
logging system for applications.
|
||||
|
||||
|
@ -222,9 +220,6 @@ functions.
|
|||
above example). In such circumstances, it is likely that specialized
|
||||
:class:`Formatter`\ s would be used with particular :class:`Handler`\ s.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
*extra* was added.
|
||||
|
||||
|
||||
.. function:: info(msg[, *args[, **kwargs]])
|
||||
|
||||
|
@ -307,9 +302,6 @@ functions.
|
|||
:func:`error` and :func:`critical` will call :func:`basicConfig` automatically
|
||||
if no handlers are defined for the root logger.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Formerly, :func:`basicConfig` did not take any keyword arguments.
|
||||
|
||||
The following keyword arguments are supported.
|
||||
|
||||
+--------------+---------------------------------------------+
|
||||
|
@ -464,9 +456,6 @@ instantiated directly, but always through the module-level function
|
|||
above example). In such circumstances, it is likely that specialized
|
||||
:class:`Formatter`\ s would be used with particular :class:`Handler`\ s.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
*extra* was added.
|
||||
|
||||
|
||||
.. method:: Logger.info(msg[, *args[, **kwargs]])
|
||||
|
||||
|
@ -536,10 +525,6 @@ instantiated directly, but always through the module-level function
|
|||
Finds the caller's source filename and line number. Returns the filename, line
|
||||
number and function name as a 3-element tuple.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The function name was added. In earlier versions, the filename and line number
|
||||
were returned as a 2-element tuple..
|
||||
|
||||
|
||||
.. method:: Logger.handle(record)
|
||||
|
||||
|
@ -554,18 +539,12 @@ instantiated directly, but always through the module-level function
|
|||
This is a factory method which can be overridden in subclasses to create
|
||||
specialized :class:`LogRecord` instances.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
*func* and *extra* were added.
|
||||
|
||||
|
||||
.. _minimal-example:
|
||||
|
||||
Basic example
|
||||
-------------
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
formerly :func:`basicConfig` did not take any keyword arguments.
|
||||
|
||||
The :mod:`logging` package provides a lot of flexibility, and its configuration
|
||||
can appear daunting. This section demonstrates that simple use of the logging
|
||||
package is possible.
|
||||
|
@ -1042,8 +1021,6 @@ sends logging output to a disk file. It inherits the output functionality from
|
|||
WatchedFileHandler
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
|
||||
module, is a :class:`FileHandler` which watches the file it is logging to. If
|
||||
the file changes, it is closed and reopened using the file name.
|
||||
|
@ -1369,9 +1346,6 @@ supports sending logging messages to an email address via SMTP.
|
|||
the standard SMTP port is used. If your SMTP server requires authentication, you
|
||||
can specify a (username, password) tuple for the *credentials* argument.
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
*credentials* was added.
|
||||
|
||||
|
||||
.. method:: SMTPHandler.emit(record)
|
||||
|
||||
|
@ -1542,9 +1516,6 @@ Currently, the useful mapping keys in a :class:`LogRecord` are:
|
|||
| | args``. |
|
||||
+-------------------------+-----------------------------------------------+
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
*funcName* was added.
|
||||
|
||||
|
||||
.. class:: Formatter([fmt[, datefmt]])
|
||||
|
||||
|
@ -1631,9 +1602,6 @@ made, and any exception information to be logged.
|
|||
the name of the function from which the logging call was made. If not
|
||||
specified, it defaults to ``None``.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
*func* was added.
|
||||
|
||||
|
||||
.. method:: LogRecord.getMessage()
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ The module defines these functions:
|
|||
:exc:`ValueError` exception is raised --- but garbage data will also be written
|
||||
to the file. The object will not be properly read back by :func:`load`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
The *version* argument indicates the data format that ``dump`` should use
|
||||
(see below).
|
||||
|
||||
|
@ -95,7 +94,6 @@ The module defines these functions:
|
|||
value must be a supported type. Raise a :exc:`ValueError` exception if value
|
||||
has (or contains an object that has) an unsupported type.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
The *version* argument indicates the data format that ``dumps`` should use
|
||||
(see below).
|
||||
|
||||
|
@ -116,8 +114,6 @@ In addition, the following constants are defined:
|
|||
Python 2.5) uses a binary format for floating point numbers. The current version
|
||||
is 2.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
|
|
|
@ -99,9 +99,6 @@ Power and logarithmic functions:
|
|||
Return the logarithm of *x* to the given *base*. If the *base* is not specified,
|
||||
return the natural logarithm of *x* (that is, the logarithm to base *e*).
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
*base* argument added.
|
||||
|
||||
|
||||
.. function:: log10(x)
|
||||
|
||||
|
|
|
@ -154,7 +154,6 @@ than one MIME-type database:
|
|||
The optional *filenames* parameter can be used to cause additional files to be
|
||||
loaded "on top" of the default database.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
An example usage of the module::
|
||||
|
||||
|
|
|
@ -35,9 +35,7 @@ to an :const:`ACCESS_WRITE` memory map affects both memory and the underlying
|
|||
file. Assignment to an :const:`ACCESS_COPY` memory map affects memory but does
|
||||
not update the underlying file.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
To map anonymous memory, -1 should be passed as the fileno along with the
|
||||
length.
|
||||
To map anonymous memory, -1 should be passed as the fileno along with the length.
|
||||
|
||||
|
||||
.. function:: mmap(fileno, length[, tagname[, access]])
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
:synopsis: Find modules used by a script.
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
This module provides a :class:`ModuleFinder` class that can be used to determine
|
||||
the set of modules imported by a script. ``modulefinder.py`` can also be run as
|
||||
a script, giving the filename of a Python script as its argument, after which a
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
|
||||
.. index:: single: msi
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
The :mod:`msilib` supports the creation of Microsoft Installer (``.msi``) files.
|
||||
Because these files often contain an embedded "cabinet" file (``.cab``), it also
|
||||
exposes an API to create CAB files. Support for reading ``.cab`` files is
|
||||
|
|
|
@ -8,10 +8,6 @@
|
|||
.. sectionauthor:: Eric S. Raymond <esr@snark.thyrsus.com>
|
||||
|
||||
|
||||
.. % Note the \protect needed for \file... ;-(
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
The :class:`netrc` class parses and encapsulates the netrc file format used by
|
||||
the Unix :program:`ftp` program and other FTP clients.
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ The :mod:`nis` module defines the following functions:
|
|||
|
||||
Note that *mapname* is first checked if it is an alias to another name.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The *domain* argument allows to override the NIS domain used for the lookup. If
|
||||
unspecified, lookup is in the default NIS domain.
|
||||
|
||||
|
@ -39,7 +38,6 @@ The :mod:`nis` module defines the following functions:
|
|||
|
||||
Note that *mapname* is first checked if it is an alias to another name.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The *domain* argument allows to override the NIS domain used for the lookup. If
|
||||
unspecified, lookup is in the default NIS domain.
|
||||
|
||||
|
@ -48,7 +46,6 @@ The :mod:`nis` module defines the following functions:
|
|||
|
||||
Return a list of all valid maps.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The *domain* argument allows to override the NIS domain used for the lookup. If
|
||||
unspecified, lookup is in the default NIS domain.
|
||||
|
||||
|
@ -57,11 +54,9 @@ The :mod:`nis` module defines the following functions:
|
|||
|
||||
Return the system default NIS domain.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
The :mod:`nis` module defines the following exception:
|
||||
|
||||
|
||||
.. exception:: error
|
||||
|
||||
An error raised when a NIS function returns an error code.
|
||||
|
|
|
@ -51,7 +51,7 @@ headers)::
|
|||
The module itself defines the following items:
|
||||
|
||||
|
||||
.. class:: NNTP(host[, port [, user[, password [, readermode] [, usenetrc]]]])
|
||||
.. class:: NNTP(host[, port [, user[, password [, readermode][, usenetrc]]]])
|
||||
|
||||
Return a new instance of the :class:`NNTP` class, representing a connection
|
||||
to the NNTP server running on host *host*, listening at port *port*. The
|
||||
|
@ -66,9 +66,6 @@ The module itself defines the following items:
|
|||
:exc:`NNTPPermanentError`\ s, you might need to set *readermode*.
|
||||
*readermode* defaults to ``None``. *usenetrc* defaults to ``True``.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
*usenetrc* argument added.
|
||||
|
||||
|
||||
.. exception:: NNTPError
|
||||
|
||||
|
@ -185,8 +182,6 @@ indicates an error, the method raises one of the above exceptions.
|
|||
strings). Return a pair ``(response, list)``, where *list* is a list of tuples
|
||||
containing ``(name, title)``.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: NNTP.description(group)
|
||||
|
||||
|
@ -197,8 +192,6 @@ indicates an error, the method raises one of the above exceptions.
|
|||
This elides the response code from the server. If the response code is needed,
|
||||
use :meth:`descriptions`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. method:: NNTP.group(name)
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ the rich comparison operators they support:
|
|||
return any value, which may or may not be interpretable as a Boolean value.
|
||||
See :ref:`comparisons` for more information about rich comparisons.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
The logical operations are also generally applicable to all objects, and support
|
||||
truth tests, identity tests, and boolean operations:
|
||||
|
@ -67,14 +66,11 @@ truth tests, identity tests, and boolean operations:
|
|||
|
||||
Return ``a is b``. Tests object identity.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: is_not(a, b)
|
||||
|
||||
Return ``a is not b``. Tests object identity.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
The mathematical and bitwise operations are the most numerous:
|
||||
|
||||
|
@ -109,8 +105,6 @@ The mathematical and bitwise operations are the most numerous:
|
|||
|
||||
Return ``a // b``.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: inv(o)
|
||||
invert(o)
|
||||
|
@ -119,9 +113,6 @@ The mathematical and bitwise operations are the most numerous:
|
|||
|
||||
Return the bitwise inverse of the number *o*. This is equivalent to ``~o``.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
The names :func:`invert` and :func:`__invert__`.
|
||||
|
||||
|
||||
.. function:: lshift(a, b)
|
||||
__lshift__(a, b)
|
||||
|
@ -164,8 +155,6 @@ The mathematical and bitwise operations are the most numerous:
|
|||
|
||||
Return ``a ** b``, for *a* and *b* numbers.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: rshift(a, b)
|
||||
__rshift__(a, b)
|
||||
|
@ -185,8 +174,6 @@ The mathematical and bitwise operations are the most numerous:
|
|||
Return ``a / b`` when ``__future__.division`` is in effect. This is also
|
||||
known as "true" division.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: xor(a, b)
|
||||
__xor__(a, b)
|
||||
|
@ -199,8 +186,6 @@ The mathematical and bitwise operations are the most numerous:
|
|||
|
||||
Return *a* converted to an integer. Equivalent to ``a.__index__()``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
Operations which work with sequences include:
|
||||
|
||||
|
@ -215,9 +200,6 @@ Operations which work with sequences include:
|
|||
|
||||
Return the outcome of the test ``b in a``. Note the reversed operands.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
The name :func:`__contains__`.
|
||||
|
||||
|
||||
.. function:: countOf(a, b)
|
||||
|
||||
|
@ -290,24 +272,18 @@ to the compound statement ``z = x; z += y``.
|
|||
|
||||
``a = iadd(a, b)`` is equivalent to ``a += b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: iand(a, b)
|
||||
__iand__(a, b)
|
||||
|
||||
``a = iand(a, b)`` is equivalent to ``a &= b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: iconcat(a, b)
|
||||
__iconcat__(a, b)
|
||||
|
||||
``a = iconcat(a, b)`` is equivalent to ``a += b`` for *a* and *b* sequences.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: idiv(a, b)
|
||||
__idiv__(a, b)
|
||||
|
@ -315,23 +291,17 @@ to the compound statement ``z = x; z += y``.
|
|||
``a = idiv(a, b)`` is equivalent to ``a /= b`` when ``__future__.division`` is
|
||||
not in effect.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: ifloordiv(a, b)
|
||||
__ifloordiv__(a, b)
|
||||
|
||||
``a = ifloordiv(a, b)`` is equivalent to ``a //= b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: ilshift(a, b)
|
||||
__ilshift__(a, b)
|
||||
|
||||
``a = ilshift(a, b)`` is equivalent to ``a <``\ ``<= b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
``a = ilshift(a, b)`` is equivalent to ``a <<= b``.
|
||||
|
||||
|
||||
.. function:: imod(a, b)
|
||||
|
@ -339,32 +309,24 @@ to the compound statement ``z = x; z += y``.
|
|||
|
||||
``a = imod(a, b)`` is equivalent to ``a %= b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: imul(a, b)
|
||||
__imul__(a, b)
|
||||
|
||||
``a = imul(a, b)`` is equivalent to ``a *= b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: ior(a, b)
|
||||
__ior__(a, b)
|
||||
|
||||
``a = ior(a, b)`` is equivalent to ``a |= b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: ipow(a, b)
|
||||
__ipow__(a, b)
|
||||
|
||||
``a = ipow(a, b)`` is equivalent to ``a **= b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: irepeat(a, b)
|
||||
__irepeat__(a, b)
|
||||
|
@ -372,24 +334,18 @@ to the compound statement ``z = x; z += y``.
|
|||
``a = irepeat(a, b)`` is equivalent to ``a *= b`` where *a* is a sequence and
|
||||
*b* is an integer.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: irshift(a, b)
|
||||
__irshift__(a, b)
|
||||
|
||||
``a = irshift(a, b)`` is equivalent to ``a >>= b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: isub(a, b)
|
||||
__isub__(a, b)
|
||||
|
||||
``a = isub(a, b)`` is equivalent to ``a -= b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: itruediv(a, b)
|
||||
__itruediv__(a, b)
|
||||
|
@ -397,16 +353,12 @@ to the compound statement ``z = x; z += y``.
|
|||
``a = itruediv(a, b)`` is equivalent to ``a /= b`` when ``__future__.division``
|
||||
is in effect.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: ixor(a, b)
|
||||
__ixor__(a, b)
|
||||
|
||||
``a = ixor(a, b)`` is equivalent to ``a ^= b``.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
The :mod:`operator` module also defines a few predicates to test the type of
|
||||
objects.
|
||||
|
@ -497,11 +449,6 @@ expect a function argument.
|
|||
``f=attrgetter('name', 'date')``, the call ``f(b)`` returns ``(b.name,
|
||||
b.date)``.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added support for multiple attributes.
|
||||
|
||||
|
||||
.. function:: itemgetter(item[, args...])
|
||||
|
||||
|
@ -510,10 +457,6 @@ expect a function argument.
|
|||
call ``f(b)`` returns ``b[2]``. After, ``f=itemgetter(2,5,3)``, the call
|
||||
``f(b)`` returns ``(b[2], b[5], b[3])``.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added support for multiple item extraction.
|
||||
|
||||
Examples::
|
||||
|
||||
|
|
|
@ -8,10 +8,6 @@
|
|||
.. module:: optparse
|
||||
:synopsis: More convenient, flexible, and powerful command-line parsing library.
|
||||
.. moduleauthor:: Greg Ward <gward@python.net>
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
.. sectionauthor:: Greg Ward <gward@python.net>
|
||||
|
||||
|
||||
|
|
|
@ -23,8 +23,6 @@ write files see :func:`open`, and for accessing the filesystem see the
|
|||
Return a normalized absolutized version of the pathname *path*. On most
|
||||
platforms, this is equivalent to ``normpath(join(os.getcwd(), path))``.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
|
||||
.. function:: basename(path)
|
||||
|
||||
|
@ -62,8 +60,6 @@ write files see :func:`open`, and for accessing the filesystem see the
|
|||
broken symbolic links. Equivalent to :func:`exists` on platforms lacking
|
||||
:func:`os.lstat`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: expanduser(path)
|
||||
|
||||
|
@ -103,9 +99,6 @@ write files see :func:`open`, and for accessing the filesystem see the
|
|||
the number of seconds since the epoch (see the :mod:`time` module). Raise
|
||||
:exc:`os.error` if the file does not exist or is inaccessible.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
If :func:`os.stat_float_times` returns True, the result is a floating point
|
||||
number.
|
||||
|
||||
|
@ -116,9 +109,6 @@ write files see :func:`open`, and for accessing the filesystem see the
|
|||
giving the number of seconds since the epoch (see the :mod:`time` module).
|
||||
Raise :exc:`os.error` if the file does not exist or is inaccessible.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
If :func:`os.stat_float_times` returns True, the result is a floating point
|
||||
number.
|
||||
|
||||
|
@ -131,16 +121,12 @@ write files see :func:`open`, and for accessing the filesystem see the
|
|||
the :mod:`time` module). Raise :exc:`os.error` if the file does not exist or
|
||||
is inaccessible.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: getsize(path)
|
||||
|
||||
Return the size, in bytes, of *path*. Raise :exc:`os.error` if the file does
|
||||
not exist or is inaccessible.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
|
||||
.. function:: isabs(path)
|
||||
|
||||
|
@ -207,8 +193,6 @@ write files see :func:`open`, and for accessing the filesystem see the
|
|||
Return the canonical path of the specified filename, eliminating any symbolic
|
||||
links encountered in the path (if they are supported by the operating system).
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: relpath(path[, start])
|
||||
|
||||
|
@ -217,8 +201,6 @@ write files see :func:`open`, and for accessing the filesystem see the
|
|||
|
||||
*start* defaults to :attr:`os.curdir`. Availability: Windows, Unix.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
|
||||
.. function:: samefile(path1, path2)
|
||||
|
||||
|
@ -260,8 +242,6 @@ write files see :func:`open`, and for accessing the filesystem see the
|
|||
specifications, *drive* will always be the empty string. In all cases, ``drive
|
||||
+ tail`` will be the same as *path*.
|
||||
|
||||
.. versionadded:: 1.3
|
||||
|
||||
|
||||
.. function:: splitext(path)
|
||||
|
||||
|
@ -270,10 +250,6 @@ write files see :func:`open`, and for accessing the filesystem see the
|
|||
period. Leading periods on the basename are ignored; ``splitext('.cshrc')``
|
||||
returns ``('.cshrc', '')``.
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
Earlier versions could produce an empty root when the only period was the
|
||||
first character.
|
||||
|
||||
|
||||
.. function:: splitunc(path)
|
||||
|
||||
|
@ -312,6 +288,3 @@ write files see :func:`open`, and for accessing the filesystem see the
|
|||
True if arbitrary Unicode strings can be used as file names (within limitations
|
||||
imposed by the file system), and if :func:`os.listdir` returns Unicode strings
|
||||
for a Unicode argument.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
|
|
@ -174,8 +174,6 @@ process and user.
|
|||
Return the process group id of the process with process id *pid*. If *pid* is 0,
|
||||
the process group id of the current process is returned. Availability: Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: getpgrp()
|
||||
|
||||
|
@ -254,8 +252,6 @@ process and user.
|
|||
identifying a group. This operation is typical available only to the superuser.
|
||||
Availability: Unix.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: setpgrp()
|
||||
|
||||
|
@ -286,8 +282,6 @@ process and user.
|
|||
Calls the system call :cfunc:`getsid`. See the Unix manual for the semantics.
|
||||
Availability: Unix.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. function:: setsid()
|
||||
|
||||
|
@ -361,11 +355,9 @@ These functions create new file objects. (See also :func:`open`.)
|
|||
and *bufsize* arguments have the same meaning as the corresponding arguments to
|
||||
the built-in :func:`open` function. Availability: Macintosh, Unix, Windows.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
When specified, the *mode* argument must now start with one of the letters
|
||||
When specified, the *mode* argument must start with one of the letters
|
||||
``'r'``, ``'w'``, or ``'a'``, otherwise a :exc:`ValueError` is raised.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
On Unix, when the *mode* argument starts with ``'a'``, the *O_APPEND* flag is
|
||||
set on the file descriptor (which the :cfunc:`fdopen` implementation already
|
||||
does on most platforms).
|
||||
|
@ -385,12 +377,6 @@ These functions create new file objects. (See also :func:`open`.)
|
|||
.. deprecated:: 2.6
|
||||
This function is obsolete. Use the :mod:`subprocess` module.
|
||||
|
||||
.. versionchanged:: 2.0
|
||||
This function worked unreliably under Windows in earlier versions of Python.
|
||||
This was due to the use of the :cfunc:`_popen` function from the libraries
|
||||
provided with Windows. Newer versions of Python do not use the broken
|
||||
implementation from the Windows libraries.
|
||||
|
||||
|
||||
.. function:: tmpfile()
|
||||
|
||||
|
@ -644,8 +630,6 @@ platforms. For descriptions of their availability and use, consult
|
|||
Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
|
||||
respectively. Availability: Windows, Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. _os-file-dir:
|
||||
|
||||
|
@ -716,8 +700,6 @@ Files and Directories
|
|||
descriptor *fd*. The descriptor must refer to an opened directory, not an open
|
||||
file. Availability: Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: getcwd()
|
||||
|
||||
|
@ -730,8 +712,6 @@ Files and Directories
|
|||
Return a Unicode object representing the current working directory.
|
||||
Availability: Macintosh, Unix, Windows.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: chflags(path, flags)
|
||||
|
||||
|
@ -751,16 +731,12 @@ Files and Directories
|
|||
|
||||
Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
|
||||
.. function:: chroot(path)
|
||||
|
||||
Change the root directory of the current process to *path*. Availability:
|
||||
Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. function:: chmod(path, mode)
|
||||
|
||||
|
@ -809,16 +785,12 @@ Files and Directories
|
|||
Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do not
|
||||
follow symbolic links. Availability: Unix.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
|
||||
.. function:: lchown(path, uid, gid)
|
||||
|
||||
Change the owner and group id of *path* to the numeric *uid* and gid. This
|
||||
function will not follow symbolic links. Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: link(src, dst)
|
||||
|
||||
|
@ -832,7 +804,6 @@ Files and Directories
|
|||
``'..'`` even if they are present in the directory. Availability: Macintosh,
|
||||
Unix, Windows.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
On Windows NT/2k/XP and Unix, if *path* is a Unicode object, the result will be
|
||||
a list of Unicode objects.
|
||||
|
||||
|
@ -867,31 +838,23 @@ Files and Directories
|
|||
``stat.S_IFBLK``, *device* defines the newly created device special file (probably using
|
||||
:func:`os.makedev`), otherwise it is ignored.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: major(device)
|
||||
|
||||
Extracts the device major number from a raw device number (usually the
|
||||
:attr:`st_dev` or :attr:`st_rdev` field from :ctype:`stat`).
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: minor(device)
|
||||
|
||||
Extracts the device minor number from a raw device number (usually the
|
||||
:attr:`st_dev` or :attr:`st_rdev` field from :ctype:`stat`).
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: makedev(major, minor)
|
||||
|
||||
Composes a raw device number from the major and minor device numbers.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: mkdir(path[, mode])
|
||||
|
||||
|
@ -917,10 +880,7 @@ Files and Directories
|
|||
:func:`makedirs` will become confused if the path elements to create include
|
||||
*os.pardir*.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
This function now handles UNC paths correctly.
|
||||
This function handles UNC paths correctly.
|
||||
|
||||
|
||||
.. function:: pathconf(path, name)
|
||||
|
@ -955,8 +915,7 @@ Files and Directories
|
|||
be converted to an absolute pathname using ``os.path.join(os.path.dirname(path),
|
||||
result)``.
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
If the *path* is a Unicode object the result will also be a Unicode object.
|
||||
If the *path* is a Unicode object, the result will also be a Unicode object.
|
||||
|
||||
Availability: Macintosh, Unix.
|
||||
|
||||
|
@ -985,8 +944,6 @@ Files and Directories
|
|||
they are empty. Raises :exc:`OSError` if the leaf directory could not be
|
||||
successfully removed.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
|
||||
.. function:: rename(src, dst)
|
||||
|
||||
|
@ -1007,8 +964,6 @@ Files and Directories
|
|||
attempted first. After the rename, directories corresponding to rightmost path
|
||||
segments of the old name will be pruned away using :func:`removedirs`.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
.. note::
|
||||
|
||||
This function can fail with the new directory structure made if you lack
|
||||
|
@ -1040,7 +995,6 @@ Files and Directories
|
|||
926L
|
||||
>>>
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
If :func:`stat_float_times` returns true, the time values are floats, measuring
|
||||
seconds. Fractions of a second may be reported if the system supports that. On
|
||||
Mac OS, the times are always floats. See :func:`stat_float_times` for further
|
||||
|
@ -1080,12 +1034,6 @@ Files and Directories
|
|||
|
||||
Availability: Macintosh, Unix, Windows.
|
||||
|
||||
.. versionchanged:: 2.2
|
||||
Added access to values as attributes of the returned object.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Added st_gen, st_birthtime.
|
||||
|
||||
|
||||
.. function:: stat_float_times([newvalue])
|
||||
|
||||
|
@ -1097,7 +1045,6 @@ Files and Directories
|
|||
For compatibility with older Python versions, accessing :class:`stat_result` as
|
||||
a tuple always returns integers.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Python now returns float values by default. Applications which do not work
|
||||
correctly with floating point time stamps can use this function to restore the
|
||||
old behaviour.
|
||||
|
@ -1131,9 +1078,6 @@ Files and Directories
|
|||
this remains useful when writing code that needs to work with versions of Python
|
||||
that don't support accessing the fields as attributes.
|
||||
|
||||
.. versionchanged:: 2.2
|
||||
Added access to values as attributes of the returned object.
|
||||
|
||||
|
||||
.. function:: symlink(src, dst)
|
||||
|
||||
|
@ -1206,9 +1150,6 @@ Files and Directories
|
|||
depending on the resolution with which your operating system records access and
|
||||
modification times; see :func:`stat`.
|
||||
|
||||
.. versionchanged:: 2.0
|
||||
Added support for ``None`` for *times*.
|
||||
|
||||
Availability: Macintosh, Unix, Windows.
|
||||
|
||||
|
||||
|
@ -1255,9 +1196,6 @@ Files and Directories
|
|||
directories. Set *followlinks* to True to visit directories pointed to by
|
||||
symlinks, on systems that support them.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
The *followlinks* parameter.
|
||||
|
||||
.. note::
|
||||
|
||||
Be aware that setting *followlinks* to true can lead to infinite recursion if a
|
||||
|
@ -1297,8 +1235,6 @@ Files and Directories
|
|||
for name in dirs:
|
||||
os.rmdir(os.path.join(root, name))
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. _os-process:
|
||||
|
||||
|
@ -1391,96 +1327,72 @@ written in Python, such as a mail server's external command delivery program.
|
|||
|
||||
Exit code that means no error occurred. Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_USAGE
|
||||
|
||||
Exit code that means the command was used incorrectly, such as when the wrong
|
||||
number of arguments are given. Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_DATAERR
|
||||
|
||||
Exit code that means the input data was incorrect. Availability: Macintosh,
|
||||
Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_NOINPUT
|
||||
|
||||
Exit code that means an input file did not exist or was not readable.
|
||||
Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_NOUSER
|
||||
|
||||
Exit code that means a specified user did not exist. Availability: Macintosh,
|
||||
Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_NOHOST
|
||||
|
||||
Exit code that means a specified host did not exist. Availability: Macintosh,
|
||||
Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_UNAVAILABLE
|
||||
|
||||
Exit code that means that a required service is unavailable. Availability:
|
||||
Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_SOFTWARE
|
||||
|
||||
Exit code that means an internal software error was detected. Availability:
|
||||
Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_OSERR
|
||||
|
||||
Exit code that means an operating system error was detected, such as the
|
||||
inability to fork or create a pipe. Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_OSFILE
|
||||
|
||||
Exit code that means some system file did not exist, could not be opened, or had
|
||||
some other kind of error. Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_CANTCREAT
|
||||
|
||||
Exit code that means a user specified output file could not be created.
|
||||
Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_IOERR
|
||||
|
||||
Exit code that means that an error occurred while doing I/O on some file.
|
||||
Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_TEMPFAIL
|
||||
|
||||
|
@ -1488,16 +1400,12 @@ written in Python, such as a mail server's external command delivery program.
|
|||
that may not really be an error, such as a network connection that couldn't be
|
||||
made during a retryable operation. Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_PROTOCOL
|
||||
|
||||
Exit code that means that a protocol exchange was illegal, invalid, or not
|
||||
understood. Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_NOPERM
|
||||
|
||||
|
@ -1505,24 +1413,18 @@ written in Python, such as a mail server's external command delivery program.
|
|||
operation (but not intended for file system problems). Availability: Macintosh,
|
||||
Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_CONFIG
|
||||
|
||||
Exit code that means that some kind of configuration error occurred.
|
||||
Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: EX_NOTFOUND
|
||||
|
||||
Exit code that means something like "an entry was not found". Availability:
|
||||
Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: fork()
|
||||
|
||||
|
@ -1559,8 +1461,6 @@ written in Python, such as a mail server's external command delivery program.
|
|||
Send the signal *sig* to the process group *pgid*. Availability: Macintosh,
|
||||
Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: nice(increment)
|
||||
|
||||
|
@ -1640,8 +1540,6 @@ written in Python, such as a mail server's external command delivery program.
|
|||
Availability: Unix, Windows. :func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp`
|
||||
and :func:`spawnvpe` are not available on Windows.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
|
||||
.. data:: P_NOWAIT
|
||||
P_NOWAITO
|
||||
|
@ -1651,8 +1549,6 @@ written in Python, such as a mail server's external command delivery program.
|
|||
will return as soon as the new process has been created, with the process ID as
|
||||
the return value. Availability: Macintosh, Unix, Windows.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
|
||||
.. data:: P_WAIT
|
||||
|
||||
|
@ -1662,8 +1558,6 @@ written in Python, such as a mail server's external command delivery program.
|
|||
of the process the run is successful, or ``-signal`` if a signal kills the
|
||||
process. Availability: Macintosh, Unix, Windows.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
|
||||
.. data:: P_DETACH
|
||||
P_OVERLAY
|
||||
|
@ -1675,8 +1569,6 @@ written in Python, such as a mail server's external command delivery program.
|
|||
process will be replaced; the :func:`spawn\*` function will not return.
|
||||
Availability: Windows.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
|
||||
.. function:: startfile(path[, operation])
|
||||
|
||||
|
@ -1700,11 +1592,6 @@ written in Python, such as a mail server's external command delivery program.
|
|||
doesn't work if it is. Use the :func:`os.path.normpath` function to ensure that
|
||||
the path is properly encoded for Win32. Availability: Windows.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
.. versionadded:: 2.5
|
||||
The *operation* parameter.
|
||||
|
||||
|
||||
.. function:: system(command)
|
||||
|
||||
|
@ -1785,8 +1672,6 @@ written in Python, such as a mail server's external command delivery program.
|
|||
argument is the same as that provided to :func:`waitpid` and :func:`wait4`.
|
||||
Availability: Unix.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. function:: wait4(pid, options)
|
||||
|
||||
|
@ -1796,8 +1681,6 @@ written in Python, such as a mail server's external command delivery program.
|
|||
information. The arguments to :func:`wait4` are the same as those provided to
|
||||
:func:`waitpid`. Availability: Unix.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. data:: WNOHANG
|
||||
|
||||
|
@ -1812,8 +1695,6 @@ written in Python, such as a mail server's external command delivery program.
|
|||
from a job control stop since their status was last reported. Availability: Some
|
||||
Unix systems.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. data:: WUNTRACED
|
||||
|
||||
|
@ -1821,28 +1702,22 @@ written in Python, such as a mail server's external command delivery program.
|
|||
their current state has not been reported since they were stopped. Availability:
|
||||
Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
The following functions take a process status code as returned by
|
||||
:func:`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be
|
||||
used to determine the disposition of a process.
|
||||
|
||||
|
||||
.. function:: WCOREDUMP(status)
|
||||
|
||||
Returns ``True`` if a core dump was generated for the process, otherwise it
|
||||
returns ``False``. Availability: Macintosh, Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: WIFCONTINUED(status)
|
||||
|
||||
Returns ``True`` if the process has been continued from a job control stop,
|
||||
otherwise it returns ``False``. Availability: Unix.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: WIFSTOPPED(status)
|
||||
|
||||
|
@ -1920,8 +1795,6 @@ Miscellaneous System Information
|
|||
5, and 15 minutes or raises :exc:`OSError` if the load average was
|
||||
unobtainable.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. function:: sysconf(name)
|
||||
|
||||
|
@ -1980,8 +1853,6 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module.
|
|||
The character which separates the base filename from the extension; for example,
|
||||
the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
|
||||
.. data:: pathsep
|
||||
|
||||
|
@ -2010,8 +1881,6 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module.
|
|||
The file path of the null device. For example: ``'/dev/null'`` for POSIX or
|
||||
``'Dev:Nul'`` for Mac OS 9. Also available via :mod:`os.path`.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. _os-miscfunc:
|
||||
|
||||
|
@ -2028,6 +1897,3 @@ Miscellaneous Functions
|
|||
though its exact quality depends on the OS implementation. On a UNIX-like
|
||||
system this will query /dev/urandom, and on Windows it will use CryptGenRandom.
|
||||
If a randomness source is not found, :exc:`NotImplementedError` will be raised.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
:synopsis: Access to OSS-compatible audio devices.
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
This module allows you to access the OSS (Open Sound System) audio interface.
|
||||
OSS is available for a wide range of open-source and commercial Unices, and is
|
||||
the standard audio interface for Linux and recent versions of FreeBSD.
|
||||
|
|
|
@ -51,9 +51,6 @@ after normal exit of the program), pdb will restart the program. Automatic
|
|||
restarting preserves pdb's state (such as breakpoints) and in most cases is more
|
||||
useful than quitting the debugger upon program's exit.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
Restarting post-mortem behavior added.
|
||||
|
||||
Typical usage to inspect a crashed program is::
|
||||
|
||||
>>> import pdb
|
||||
|
@ -252,8 +249,6 @@ commands [*bpnumber*]
|
|||
that are to print a specific message and then continue. If none of the other
|
||||
commands print anything, you see no sign that the breakpoint was reached.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
s(tep)
|
||||
Execute the current line, stop at the first possible occasion (either in a
|
||||
function that is called or on the next line in the current function).
|
||||
|
@ -338,8 +333,6 @@ run [*args* ...]
|
|||
with "shlex" and the result is used as the new sys.argv. History, breakpoints,
|
||||
actions and debugger options are preserved. "restart" is an alias for "run".
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
q(uit)
|
||||
Quit from the debugger. The program being executed is aborted.
|
||||
|
||||
|
|
|
@ -130,9 +130,6 @@ If a *protocol* is not specified, protocol 0 is used. If *protocol* is specified
|
|||
as a negative value or :const:`HIGHEST_PROTOCOL`, the highest protocol version
|
||||
available will be used.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
Introduced the *protocol* parameter.
|
||||
|
||||
A binary format, which is slightly more efficient, can be chosen by specifying a
|
||||
*protocol* version >= 1.
|
||||
|
||||
|
@ -151,8 +148,6 @@ an unpickler, then you call the unpickler's :meth:`load` method. The
|
|||
The highest protocol version available. This value can be passed as a
|
||||
*protocol* value.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
.. note::
|
||||
|
||||
Be sure to always open pickle files created with protocols >= 1 in binary mode.
|
||||
|
@ -176,9 +171,6 @@ process more convenient:
|
|||
specified as a negative value or :const:`HIGHEST_PROTOCOL`, the highest protocol
|
||||
version will be used.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
Introduced the *protocol* parameter.
|
||||
|
||||
*file* must have a :meth:`write` method that accepts a single string argument.
|
||||
It can thus be a file object opened for writing, a :mod:`StringIO` object, or
|
||||
any other custom object that meets this interface.
|
||||
|
@ -209,9 +201,6 @@ process more convenient:
|
|||
specified as a negative value or :const:`HIGHEST_PROTOCOL`, the highest protocol
|
||||
version will be used.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
The *protocol* parameter was added.
|
||||
|
||||
|
||||
.. function:: loads(string)
|
||||
|
||||
|
@ -252,9 +241,6 @@ The :mod:`pickle` module also exports two callables [#]_, :class:`Pickler` and
|
|||
specified as a negative value or :const:`HIGHEST_PROTOCOL`, the highest
|
||||
protocol version will be used.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
Introduced the *protocol* parameter.
|
||||
|
||||
*file* must have a :meth:`write` method that accepts a single string argument.
|
||||
It can thus be an open file object, a :mod:`StringIO` object, or any other
|
||||
custom object that meets this interface.
|
||||
|
@ -494,10 +480,7 @@ value. The semantics of each element are:
|
|||
:exc:`UnpicklingError` will be raised in the unpickling environment. Note that
|
||||
as usual, the callable itself is pickled by name.
|
||||
|
||||
* A tuple of arguments for the callable object.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Formerly, this argument could also be ``None``.
|
||||
* A tuple of arguments for the callable object, not ``None``.
|
||||
|
||||
* Optionally, the object's state, which will be passed to the object's
|
||||
:meth:`__setstate__` method as described in section :ref:`pickle-inst`. If the
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
opcodes, as well as some useful functions.
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
This module contains various constants relating to the intimate details of the
|
||||
:mod:`pickle` module, some lengthy comments about the implementation, and a few
|
||||
useful functions for analyzing pickled data. The contents of this module are
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
:synopsis: Utilities to support extension of packages.
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
This module provides a single function:
|
||||
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Bjorn Pettersen <bpettersen@corp.fairisaac.com>
|
||||
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
.. note::
|
||||
|
||||
Specific platforms listed alphabetically, with Linux included in the Unix
|
||||
|
@ -93,23 +91,17 @@ Cross Platform
|
|||
|
||||
Returns a string identifying the Python implementation SCM branch.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
|
||||
.. function:: python_implementation()
|
||||
|
||||
Returns a string identifying the Python implementation. Possible return values
|
||||
are: 'CPython', 'IronPython', 'Jython'
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
|
||||
.. function:: python_revision()
|
||||
|
||||
Returns a string identifying the Python implementation SCM revision.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
|
||||
.. function:: python_version()
|
||||
|
||||
|
|
|
@ -37,9 +37,6 @@ A single class is provided by the :mod:`poplib` module:
|
|||
connection attempt (if not specified, or passed as None, the global default
|
||||
timeout setting will be used).
|
||||
|
||||
.. versionchanged:: 2.6
|
||||
*timeout* was added.
|
||||
|
||||
|
||||
.. class:: POP3_SSL(host[, port[, keyfile[, certfile]]])
|
||||
|
||||
|
@ -48,7 +45,6 @@ A single class is provided by the :mod:`poplib` module:
|
|||
port is used. *keyfile* and *certfile* are also optional - they can contain a
|
||||
PEM formatted private key and certificate chain file for the SSL connection.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
One exception is defined as an attribute of the :mod:`poplib` module:
|
||||
|
||||
|
|
|
@ -20,10 +20,7 @@ breaks them onto multiple lines if they don't fit within the allowed width.
|
|||
Construct :class:`PrettyPrinter` objects explicitly if you need to adjust the
|
||||
width constraint.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
Dictionaries are sorted by key before the display is computed; before 2.5, a
|
||||
dictionary was sorted only if its display required more than one line, although
|
||||
that wasn't documented.
|
||||
Dictionaries are sorted by key before the display is computed.
|
||||
|
||||
The :mod:`pprint` module defines one class:
|
||||
|
||||
|
@ -84,9 +81,6 @@ The :class:`PrettyPrinter` class supports several derivative functions:
|
|||
and *depth* will be passed to the :class:`PrettyPrinter` constructor as
|
||||
formatting parameters.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The parameters *indent*, *width* and *depth* were added.
|
||||
|
||||
|
||||
.. function:: pprint(object[, stream[, indent[, width[, depth]]]])
|
||||
|
||||
|
@ -107,9 +101,6 @@ The :class:`PrettyPrinter` class supports several derivative functions:
|
|||
'/usr/local/lib/python1.5/sharedmodules',
|
||||
'/usr/local/lib/python1.5/tkinter']
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
The parameters *indent*, *width* and *depth* were added.
|
||||
|
||||
|
||||
.. function:: isreadable(object)
|
||||
|
||||
|
@ -208,6 +199,3 @@ are converted to strings. The default implementation uses the internals of the
|
|||
is no requested limit. This argument should be passed unmodified to recursive
|
||||
calls. The fourth argument, *level*, gives the current level; recursive calls
|
||||
should be passed a value less than that of the current call.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
|
|
@ -62,22 +62,13 @@ The Python standard library provides three different profilers:
|
|||
#. :mod:`profile`, a pure Python module, described in the sequel. Copyright ©
|
||||
1994, by InfoSeek Corporation.
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
also reports the time spent in calls to built-in functions and methods.
|
||||
|
||||
#. :mod:`cProfile`, a module written in C, with a reasonable overhead that makes
|
||||
it suitable for profiling long-running programs. Based on :mod:`lsprof`,
|
||||
contributed by Brett Rosen and Ted Czotter.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
#. :mod:`hotshot`, a C module focusing on minimizing the overhead while
|
||||
profiling, at the expense of long data post-processing times.
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
the results should be more meaningful than in the past: the timing core
|
||||
contained a critical bug.
|
||||
|
||||
The :mod:`profile` and :mod:`cProfile` modules export the same interface, so
|
||||
they are mostly interchangeables; :mod:`cProfile` has a much lower overhead but
|
||||
is not so far as well-tested and might not be available on all systems.
|
||||
|
@ -376,11 +367,6 @@ Analysis of the profiler data is done using the :class:`Stats` class.
|
|||
a single report. If additional files need to be combined with data in an
|
||||
existing :class:`Stats` object, the :meth:`add` method can be used.
|
||||
|
||||
.. % (such as the old system profiler).
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
The *stream* parameter was added.
|
||||
|
||||
|
||||
.. _profile-stats:
|
||||
|
||||
|
@ -419,8 +405,6 @@ The :class:`Stats` Class
|
|||
exists. This is equivalent to the method of the same name on the
|
||||
:class:`profile.Profile` and :class:`cProfile.Profile` classes.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. method:: Stats.sort_stats(key[, ...])
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
.. sectionauthor:: Ka-Ping Yee <ping@lfw.org>
|
||||
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
.. index::
|
||||
single: documentation; generation
|
||||
single: documentation; online
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
.. % should be marked using the \member macro and should not include the
|
||||
.. % parentheses used when marking functions and methods.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
.. index:: single: Expat
|
||||
|
||||
The :mod:`xml.parsers.expat` module is a Python interface to the Expat
|
||||
|
@ -147,8 +145,6 @@ XMLParser Objects
|
|||
in the encoding of the entity which contains the text. When called while an
|
||||
event handler is not active, the return value is ``None``.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. method:: xmlparser.ExternalEntityParserCreate(context[, encoding])
|
||||
|
||||
|
@ -177,8 +173,6 @@ XMLParser Objects
|
|||
:exc:`ExpatError` to be raised with the :attr:`code` attribute set to
|
||||
:const:`errors.XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING`.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
:class:`xmlparser` objects have the following attributes:
|
||||
|
||||
|
||||
|
@ -187,8 +181,6 @@ XMLParser Objects
|
|||
The size of the buffer used when :attr:`buffer_text` is true. This value cannot
|
||||
be changed at this time.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. attribute:: xmlparser.buffer_text
|
||||
|
||||
|
@ -199,8 +191,6 @@ XMLParser Objects
|
|||
at every line ending. This attribute is false by default, and may be changed at
|
||||
any time.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. attribute:: xmlparser.buffer_used
|
||||
|
||||
|
@ -208,8 +198,6 @@ XMLParser Objects
|
|||
These bytes represent UTF-8 encoded text. This attribute has no meaningful
|
||||
interpretation when :attr:`buffer_text` is false.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
|
||||
.. attribute:: xmlparser.ordered_attributes
|
||||
|
||||
|
@ -220,8 +208,6 @@ XMLParser Objects
|
|||
module also used this format.) By default, this attribute is false; it may be
|
||||
changed at any time.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. attribute:: xmlparser.specified_attributes
|
||||
|
||||
|
@ -232,7 +218,6 @@ XMLParser Objects
|
|||
needed to comply with the standards for the behavior of XML processors. By
|
||||
default, this attribute is false; it may be changed at any time.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
The following attributes contain values relating to the most recent error
|
||||
encountered by an :class:`xmlparser` object, and will only have correct values
|
||||
|
@ -268,8 +253,6 @@ the event. When called outside of a callback, the position indicated will be
|
|||
just past the last parse event (regardless of whether there was an associated
|
||||
callback).
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. attribute:: xmlparser.CurrentByteIndex
|
||||
|
||||
|
@ -302,8 +285,6 @@ otherwise stated.
|
|||
or ``-1`` if the standalone clause was omitted. This is only available with
|
||||
Expat version 1.95.0 or newer.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. method:: xmlparser.StartDoctypeDeclHandler(doctypeName, systemId, publicId, has_internal_subset)
|
||||
|
||||
|
@ -386,8 +367,6 @@ otherwise stated.
|
|||
general entities). This is only available starting with version 1.95.0 of the
|
||||
Expat library.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. method:: xmlparser.NotationDeclHandler(notationName, base, systemId, publicId)
|
||||
|
||||
|
@ -491,23 +470,17 @@ ExpatError Exceptions
|
|||
Expat's internal error number for the specific error. This will match one of
|
||||
the constants defined in the ``errors`` object from this module.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. attribute:: ExpatError.lineno
|
||||
|
||||
Line number on which the error was detected. The first line is numbered ``1``.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. attribute:: ExpatError.offset
|
||||
|
||||
Character offset into the line where the error occurred. The first column is
|
||||
numbered ``0``.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. _expat-example:
|
||||
|
||||
|
|
|
@ -74,9 +74,6 @@ See the source code for details. The public methods are:
|
|||
immediately available, else raise the :exc:`Full` exception (*timeout* is
|
||||
ignored in that case).
|
||||
|
||||
.. versionadded:: 2.3
|
||||
The *timeout* parameter.
|
||||
|
||||
|
||||
.. method:: Queue.put_nowait(item)
|
||||
|
||||
|
@ -92,9 +89,6 @@ See the source code for details. The public methods are:
|
|||
Otherwise (*block* is false), return an item if one is immediately available,
|
||||
else raise the :exc:`Empty` exception (*timeout* is ignored in that case).
|
||||
|
||||
.. versionadded:: 2.3
|
||||
The *timeout* parameter.
|
||||
|
||||
|
||||
.. method:: Queue.get_nowait()
|
||||
|
||||
|
@ -117,8 +111,6 @@ fully processed by daemon consumer threads.
|
|||
Raises a :exc:`ValueError` if called more times than there were items placed in
|
||||
the queue.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
|
||||
.. method:: Queue.join()
|
||||
|
||||
|
@ -129,7 +121,6 @@ fully processed by daemon consumer threads.
|
|||
indicate that the item was retrieved and all work on it is complete. When the
|
||||
count of unfinished tasks drops to zero, join() unblocks.
|
||||
|
||||
.. versionadded:: 2.5
|
||||
|
||||
Example of how to wait for enqueued tasks to be completed::
|
||||
|
||||
|
|
|
@ -39,9 +39,6 @@ basic generator of your own devising: in that case, override the :meth:`random`,
|
|||
Optionally, a new generator can supply a :meth:`getrandombits` method --- this
|
||||
allows :meth:`randrange` to produce selections over an arbitrarily large range.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
the :meth:`getrandombits` method.
|
||||
|
||||
As an example of subclassing, the :mod:`random` module provides the
|
||||
:class:`WichmannHill` class that implements an alternative generator in pure
|
||||
Python. The class provides a backward compatible way to reproduce results from
|
||||
|
@ -51,9 +48,6 @@ its period is too short by contemporary standards, and the sequence generated is
|
|||
known to fail some stringent randomness tests. See the references below for a
|
||||
recent variant that repairs these flaws.
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
Substituted MersenneTwister for Wichmann-Hill.
|
||||
|
||||
Bookkeeping functions:
|
||||
|
||||
|
||||
|
@ -66,9 +60,6 @@ Bookkeeping functions:
|
|||
they are used instead of the system time (see the :func:`os.urandom` function
|
||||
for details on availability).
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
formerly, operating system resources were not used.
|
||||
|
||||
If *x* is not ``None`` or an int or long, ``hash(x)`` is used instead. If *x* is
|
||||
an int or long, *x* is used directly.
|
||||
|
||||
|
@ -78,8 +69,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.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. function:: setstate(state)
|
||||
|
||||
|
@ -87,8 +76,6 @@ Bookkeeping functions:
|
|||
:func:`setstate` restores the internal state of the generator to what it was at
|
||||
the time :func:`setstate` was called.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
|
||||
.. function:: jumpahead(n)
|
||||
|
||||
|
@ -100,12 +87,6 @@ Bookkeeping functions:
|
|||
same internal state, and then :meth:`jumpahead` can be used to force the
|
||||
instances' states far apart.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
.. versionchanged:: 2.3
|
||||
Instead of jumping to a specific state, *n* steps ahead, ``jumpahead(n)``
|
||||
jumps to another state likely to be separated by many steps.
|
||||
|
||||
|
||||
.. function:: getrandbits(k)
|
||||
|
||||
|
@ -114,26 +95,22 @@ Bookkeeping functions:
|
|||
as an optional part of the API. When available, :meth:`getrandbits` enables
|
||||
:meth:`randrange` to handle arbitrarily large ranges.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
Functions for integers:
|
||||
|
||||
|
||||
.. function:: randrange([start,] stop[, step])
|
||||
|
||||
Return a randomly selected element from ``range(start, stop, step)``. This is
|
||||
equivalent to ``choice(range(start, stop, step))``, but doesn't actually build a
|
||||
range object.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
|
||||
.. function:: randint(a, b)
|
||||
|
||||
Return a random integer *N* such that ``a <= N <= b``.
|
||||
|
||||
Functions for sequences:
|
||||
|
||||
Functions for sequences:
|
||||
|
||||
.. function:: choice(seq)
|
||||
|
||||
|
@ -157,8 +134,6 @@ Functions for sequences:
|
|||
Return a *k* length list of unique elements chosen from the population sequence.
|
||||
Used for random sampling without replacement.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
Returns a new list containing elements from the population while leaving the
|
||||
original population unchanged. The resulting list is in selection order so that
|
||||
all sub-slices will also be valid random samples. This allows raffle winners
|
||||
|
@ -274,7 +249,6 @@ Alternative Generators:
|
|||
The :meth:`getstate` and :meth:`setstate` methods raise
|
||||
:exc:`NotImplementedError` if called.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
Examples of basic usage::
|
||||
|
||||
|
|
|
@ -287,7 +287,6 @@ The special characters are:
|
|||
matching pattern, which will match with ``'<user@host.com>'`` as well as
|
||||
``'user@host.com'``, but not with ``'<user@host.com'``.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
The special sequences consist of ``'\'`` and a character from the list below.
|
||||
If the ordinary character is not on the list, then the resulting RE will match
|
||||
|
@ -492,8 +491,6 @@ form.
|
|||
Make ``\w``, ``\W``, ``\b``, ``\B``, ``\d``, ``\D``, ``\s`` and ``\S`` dependent
|
||||
on the Unicode character properties database.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
|
||||
.. data:: X
|
||||
VERBOSE
|
||||
|
@ -557,11 +554,6 @@ form.
|
|||
a list of tuples if the pattern has more than one group. Empty matches are
|
||||
included in the result unless they touch the beginning of another match.
|
||||
|
||||
.. versionadded:: 1.5.2
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Added the optional flags argument.
|
||||
|
||||
|
||||
.. function:: finditer(pattern, string[, flags])
|
||||
|
||||
|
@ -569,11 +561,6 @@ form.
|
|||
*string*. For each match, the iterator returns a match object. Empty matches
|
||||
are included in the result unless they touch the beginning of another match.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
.. versionchanged:: 2.4
|
||||
Added the optional flags argument.
|
||||
|
||||
|
||||
.. function:: sub(pattern, repl, string[, count])
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue