Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e6959648
Commit
e6959648
authored
Apr 03, 2013
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 2.7.4 release branch
parents
f6d515fc
280b9e1a
Changes
45
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
341 additions
and
114 deletions
+341
-114
Doc/c-api/unicode.rst
Doc/c-api/unicode.rst
+2
-0
Doc/distutils/apiref.rst
Doc/distutils/apiref.rst
+8
-0
Doc/faq/extending.rst
Doc/faq/extending.rst
+3
-1
Doc/faq/general.rst
Doc/faq/general.rst
+4
-1
Doc/faq/gui.rst
Doc/faq/gui.rst
+3
-1
Doc/faq/library.rst
Doc/faq/library.rst
+3
-1
Doc/faq/programming.rst
Doc/faq/programming.rst
+3
-1
Doc/faq/windows.rst
Doc/faq/windows.rst
+3
-1
Doc/howto/logging-cookbook.rst
Doc/howto/logging-cookbook.rst
+1
-1
Doc/howto/logging.rst
Doc/howto/logging.rst
+2
-0
Doc/install/index.rst
Doc/install/index.rst
+2
-0
Doc/library/codecs.rst
Doc/library/codecs.rst
+6
-0
Doc/library/email.mime.rst
Doc/library/email.mime.rst
+9
-0
Doc/library/itertools.rst
Doc/library/itertools.rst
+12
-0
Doc/library/json.rst
Doc/library/json.rst
+14
-6
Doc/library/locale.rst
Doc/library/locale.rst
+2
-0
Doc/library/logging.rst
Doc/library/logging.rst
+2
-0
Doc/library/socket.rst
Doc/library/socket.rst
+1
-1
Doc/library/subprocess.rst
Doc/library/subprocess.rst
+3
-1
Doc/library/sys.rst
Doc/library/sys.rst
+5
-1
Doc/library/time.rst
Doc/library/time.rst
+2
-2
Doc/library/turtle.rst
Doc/library/turtle.rst
+3
-1
Doc/library/unittest.rst
Doc/library/unittest.rst
+10
-3
Doc/library/warnings.rst
Doc/library/warnings.rst
+2
-0
Doc/library/xml.etree.elementtree.rst
Doc/library/xml.etree.elementtree.rst
+2
-0
Doc/reference/datamodel.rst
Doc/reference/datamodel.rst
+2
-0
Doc/reference/expressions.rst
Doc/reference/expressions.rst
+1
-1
Doc/reference/simple_stmts.rst
Doc/reference/simple_stmts.rst
+1
-1
Doc/tools/sphinxext/susp-ignored.csv
Doc/tools/sphinxext/susp-ignored.csv
+30
-42
Doc/tools/sphinxext/suspicious.py
Doc/tools/sphinxext/suspicious.py
+11
-0
Lib/_abcoll.py
Lib/_abcoll.py
+70
-0
Lib/idlelib/MultiCall.py
Lib/idlelib/MultiCall.py
+3
-2
Lib/idlelib/NEWS.txt
Lib/idlelib/NEWS.txt
+7
-0
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+21
-6
Lib/idlelib/rpc.py
Lib/idlelib/rpc.py
+1
-1
Lib/inspect.py
Lib/inspect.py
+1
-1
Lib/logging/config.py
Lib/logging/config.py
+6
-0
Lib/smtplib.py
Lib/smtplib.py
+2
-2
Lib/test/test_inspect.py
Lib/test/test_inspect.py
+6
-0
Lib/test/test_kqueue.py
Lib/test/test_kqueue.py
+13
-22
Lib/test/test_queue.py
Lib/test/test_queue.py
+4
-1
Lib/test/test_urllib2_localnet.py
Lib/test/test_urllib2_localnet.py
+5
-0
Lib/unittest/case.py
Lib/unittest/case.py
+12
-13
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+37
-0
No files found.
Doc/c-api/unicode.rst
View file @
e6959648
...
@@ -252,6 +252,8 @@ APIs:
...
@@ -252,6 +252,8 @@ APIs:
.. % because not all compilers support the %z width modifier -- we fake it
.. % because not all compilers support the %z width modifier -- we fake it
.. % when necessary via interpolating PY_FORMAT_SIZE_T.
.. % when necessary via interpolating PY_FORMAT_SIZE_T.
.. tabularcolumns:: |l|l|L|
+-------------------+---------------------+--------------------------------+
+-------------------+---------------------+--------------------------------+
| Format Characters | Type | Comment |
| Format Characters | Type | Comment |
+===================+=====================+================================+
+===================+=====================+================================+
...
...
Doc/distutils/apiref.rst
View file @
e6959648
...
@@ -26,6 +26,8 @@ setup script). Indirectly provides the :class:`distutils.dist.Distribution` and
...
@@ -26,6 +26,8 @@ setup script). Indirectly provides the :class:`distutils.dist.Distribution` and
The setup function takes a large number of arguments. These are laid out in the
The setup function takes a large number of arguments. These are laid out in the
following table.
following table.
.. tabularcolumns:: |l|L|L|
+--------------------+--------------------------------+-------------------------------------------------------------+
+--------------------+--------------------------------+-------------------------------------------------------------+
| argument name | value | type |
| argument name | value | type |
+====================+================================+=============================================================+
+====================+================================+=============================================================+
...
@@ -125,6 +127,8 @@ setup script). Indirectly provides the :class:`distutils.dist.Distribution` and
...
@@ -125,6 +127,8 @@ setup script). Indirectly provides the :class:`distutils.dist.Distribution` and
*stop_after* tells :func:`setup` when to stop processing; possible values:
*stop_after* tells :func:`setup` when to stop processing; possible values:
.. tabularcolumns:: |l|L|
+---------------+---------------------------------------------+
+---------------+---------------------------------------------+
| value | description |
| value | description |
+===============+=============================================+
+===============+=============================================+
...
@@ -165,6 +169,8 @@ the full reference.
...
@@ -165,6 +169,8 @@ the full reference.
The Extension class describes a single C or C++extension module in a setup
The Extension class describes a single C or C++extension module in a setup
script. It accepts the following keyword arguments in its constructor
script. It accepts the following keyword arguments in its constructor
.. tabularcolumns:: |l|L|l|
+------------------------+--------------------------------+---------------------------+
+------------------------+--------------------------------+---------------------------+
| argument name | value | type |
| argument name | value | type |
+========================+================================+===========================+
+========================+================================+===========================+
...
@@ -1556,6 +1562,8 @@ lines, and joining lines with backslashes.
...
@@ -1556,6 +1562,8 @@ lines, and joining lines with backslashes.
The options are all boolean, and affect the values returned by :meth:`readline`
The options are all boolean, and affect the values returned by :meth:`readline`
.. tabularcolumns:: |l|L|l|
+------------------+--------------------------------+---------+
+------------------+--------------------------------+---------+
| option name | description | default |
| option name | description | default |
+==================+================================+=========+
+==================+================================+=========+
...
...
Doc/faq/extending.rst
View file @
e6959648
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
Extending/Embedding FAQ
Extending/Embedding FAQ
=======================
=======================
.. contents::
.. only:: html
.. contents::
.. highlight:: c
.. highlight:: c
...
...
Doc/faq/general.rst
View file @
e6959648
...
@@ -4,7 +4,10 @@
...
@@ -4,7 +4,10 @@
General Python FAQ
General Python FAQ
==================
==================
.. contents::
.. only:: html
.. contents::
General Information
General Information
===================
===================
...
...
Doc/faq/gui.rst
View file @
e6959648
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
Graphic User Interface FAQ
Graphic User Interface FAQ
==========================
==========================
.. contents::
.. only:: html
.. contents::
What platform-independent GUI toolkits exist for Python?
What platform-independent GUI toolkits exist for Python?
========================================================
========================================================
...
...
Doc/faq/library.rst
View file @
e6959648
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
Library and Extension FAQ
Library and Extension FAQ
=========================
=========================
.. contents::
.. only:: html
.. contents::
General Library Questions
General Library Questions
=========================
=========================
...
...
Doc/faq/programming.rst
View file @
e6959648
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
Programming FAQ
Programming FAQ
===============
===============
.. contents::
.. only:: html
.. contents::
General Questions
General Questions
=================
=================
...
...
Doc/faq/windows.rst
View file @
e6959648
...
@@ -6,7 +6,9 @@
...
@@ -6,7 +6,9 @@
Python on Windows FAQ
Python on Windows FAQ
=====================
=====================
.. contents::
.. only:: html
.. contents::
How do I run a Python program under Windows?
How do I run a Python program under Windows?
--------------------------------------------
--------------------------------------------
...
...
Doc/howto/logging-cookbook.rst
View file @
e6959648
...
@@ -773,7 +773,7 @@ UTF-8, then you need to do the following:
...
@@ -773,7 +773,7 @@ UTF-8, then you need to do the following:
u'ASCII section\ufeffUnicode section'
u'ASCII section\ufeffUnicode section'
The Unicode code point ``u'\
feff`
``, when encoded using UTF-8, will be
The Unicode code point ``u'\
ufeff'
``, when encoded using UTF-8, will be
encoded as a UTF-8 BOM -- the byte-string ``'\xef\xbb\xbf'``.
encoded as a UTF-8 BOM -- the byte-string ``'\xef\xbb\xbf'``.
#. Replace the ASCII section with whatever placeholders you like, but make sure
#. Replace the ASCII section with whatever placeholders you like, but make sure
...
...
Doc/howto/logging.rst
View file @
e6959648
...
@@ -63,6 +63,8 @@ The logging functions are named after the level or severity of the events
...
@@ -63,6 +63,8 @@ The logging functions are named after the level or severity of the events
they are used to track. The standard levels and their applicability are
they are used to track. The standard levels and their applicability are
described below (in increasing order of severity):
described below (in increasing order of severity):
.. tabularcolumns:: |l|L|
+--------------+---------------------------------------------+
+--------------+---------------------------------------------+
| Level | When it's used |
| Level | When it's used |
+==============+=============================================+
+==============+=============================================+
...
...
Doc/install/index.rst
View file @
e6959648
...
@@ -235,6 +235,8 @@ by how you built/installed Python itself. On Unix (and Mac OS X, which is also
...
@@ -235,6 +235,8 @@ by how you built/installed Python itself. On Unix (and Mac OS X, which is also
Unix-based), it also depends on whether the module distribution being installed
Unix-based), it also depends on whether the module distribution being installed
is pure Python or contains extensions ("non-pure"):
is pure Python or contains extensions ("non-pure"):
.. tabularcolumns:: |l|l|l|l|
+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
| Platform | Standard installation location | Default value | Notes |
| Platform | Standard installation location | Default value | Notes |
+=================+=====================================================+==================================================+=======+
+=================+=====================================================+==================================================+=======+
...
...
Doc/library/codecs.rst
View file @
e6959648
...
@@ -320,6 +320,8 @@ To simplify and standardize error handling, the :meth:`encode` and
...
@@ -320,6 +320,8 @@ To simplify and standardize error handling, the :meth:`encode` and
providing the *errors* string argument. The following string values are defined
providing the *errors* string argument. The following string values are defined
and implemented by all standard Python codecs:
and implemented by all standard Python codecs:
.. tabularcolumns:: |l|L|
+-------------------------+-----------------------------------------------+
+-------------------------+-----------------------------------------------+
|
Value | Meaning |
|
Value | Meaning |
+=========================+===============================================+
+=========================+===============================================+
...
@@ -887,6 +889,8 @@ particular, the following variants typically exist:
...
@@ -887,6 +889,8 @@ particular, the following variants typically exist:
* an IBM PC code page, which is ASCII compatible
* an IBM PC code page, which is ASCII compatible
.. tabularcolumns:: |l|p{0.3\linewidth}|p{0.3\linewidth}|
+-----------------+--------------------------------+--------------------------------+
+-----------------+--------------------------------+--------------------------------+
|
Codec | Aliases | Languages |
|
Codec | Aliases | Languages |
+=================+================================+================================+
+=================+================================+================================+
...
@@ -1103,6 +1107,8 @@ For the codecs listed below, the result in the "encoding" direction is always a
...
@@ -1103,6 +1107,8 @@ For the codecs listed below, the result in the "encoding" direction is always a
byte string. The result of the "decoding" direction is listed as operand type in
byte string. The result of the "decoding" direction is listed as operand type in
the table.
the table.
.. tabularcolumns:: |l|p{0.3\linewidth}|l|p{0.3\linewidth}|
+--------------------+---------------------------+----------------+---------------------------+
+--------------------+---------------------------+----------------+---------------------------+
|
Codec | Aliases | Operand type | Purpose |
|
Codec | Aliases | Operand type | Purpose |
+====================+===========================+================+===========================+
+====================+===========================+================+===========================+
...
...
Doc/library/email.mime.rst
View file @
e6959648
...
@@ -199,3 +199,12 @@ Here are the classes:
...
@@ -199,3 +199,12 @@ Here are the classes:
Transfer Encoding now happens implicitly based on the *_charset*
Transfer Encoding now happens implicitly based on the *_charset*
argument.
argument.
Unless the ``_charset`` parameter is explicitly set to ``None``, the
MIMEText object created will have both a :mailheader:`Content-Type` header
with a ``charset`` parameter, and a :mailheader:`Content-Transfer-Endcoding`
header. This means that a subsequent ``set_payload`` call will not result
in an encoded payload, even if a charset is passed in the ``set_payload``
command. You can "reset" this behavior by deleting the
``Content-Transfer-Encoding`` header, after which a ``set_payload`` call
will automatically encode the new payload (and add a new
:mailheader:`Content-Transfer-Encoding` header).
Doc/library/itertools.rst
View file @
e6959648
...
@@ -828,6 +828,18 @@ which incur interpreter overhead.
...
@@ -828,6 +828,18 @@ which incur interpreter overhead.
indices = sorted(random.randrange(n) for i in xrange(r))
indices = sorted(random.randrange(n) for i in xrange(r))
return tuple(pool[i] for i in indices)
return tuple(pool[i] for i in indices)
def tee_lookahead(t, i):
"""Inspect the i-th upcomping value from a tee object
while leaving the tee object at its current position.
Raise an IndexError if the underlying iterator doesn't
have enough values.
"""
for value in islice(t.__copy__(), i, None):
return value
raise IndexError(i)
Note, many of the above recipes can be optimized by replacing global lookups
Note, many of the above recipes can be optimized by replacing global lookups
with local variables defined as default values. For example, the
with local variables defined as default values. For example, the
*dotproduct* recipe can be written as::
*dotproduct* recipe can be written as::
...
...
Doc/library/json.rst
View file @
e6959648
...
@@ -125,7 +125,8 @@ Basic Usage
...
@@ -125,7 +125,8 @@ Basic Usage
default=None, sort_keys=False, **kw)
default=None, sort_keys=False, **kw)
Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting
Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting
:term:`file-like object`).
:term:`file-like object`) using this :ref:`conversion table
<py-to-json-table>`.
If *skipkeys* is ``True`` (default: ``False``), then dict keys that are not
If *skipkeys* is ``True`` (default: ``False``), then dict keys that are not
of a basic type (:class:`str`, :class:`unicode`, :class:`int`, :class:`long`,
of a basic type (:class:`str`, :class:`unicode`, :class:`int`, :class:`long`,
...
@@ -188,9 +189,10 @@ Basic Usage
...
@@ -188,9 +189,10 @@ Basic Usage
indent=None, separators=None, encoding="utf-8", \
indent=None, separators=None, encoding="utf-8", \
default=None, sort_keys=False, **kw)
default=None, sort_keys=False, **kw)
Serialize *obj* to a JSON formatted :class:`str`. If *ensure_ascii* is
Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion
``False``, the result may contain non-ASCII characters and the return value
table <py-to-json-table>`. If *ensure_ascii* is ``False``, the result may
may be a :class:`unicode` instance.
contain non-ASCII characters and the return value may be a :class:`unicode`
instance.
The arguments have the same meaning as in :func:`dump`.
The arguments have the same meaning as in :func:`dump`.
...
@@ -206,7 +208,8 @@ Basic Usage
...
@@ -206,7 +208,8 @@ Basic Usage
.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]])
.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]])
Deserialize *fp* (a ``.read()``-supporting :term:`file-like object`
Deserialize *fp* (a ``.read()``-supporting :term:`file-like object`
containing a JSON document) to a Python object.
containing a JSON document) to a Python object using this :ref:`conversion
table <json-to-py-table>`.
If the contents of *fp* are encoded with an ASCII based encoding other than
If the contents of *fp* are encoded with an ASCII based encoding other than
UTF-8 (e.g. latin-1), then an appropriate *encoding* name must be specified.
UTF-8 (e.g. latin-1), then an appropriate *encoding* name must be specified.
...
@@ -257,7 +260,8 @@ Basic Usage
...
@@ -257,7 +260,8 @@ Basic Usage
.. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]])
.. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]])
Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON
Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON
document) to a Python object.
document) to a Python object using this :ref:`conversion table
<json-to-py-table>`.
If *s* is a :class:`str` instance and is encoded with an ASCII based encoding
If *s* is a :class:`str` instance and is encoded with an ASCII based encoding
other than UTF-8 (e.g. latin-1), then an appropriate *encoding* name must be
other than UTF-8 (e.g. latin-1), then an appropriate *encoding* name must be
...
@@ -276,6 +280,8 @@ Encoders and Decoders
...
@@ -276,6 +280,8 @@ Encoders and Decoders
Performs the following translations in decoding by default:
Performs the following translations in decoding by default:
.. _json-to-py-table:
+---------------+-------------------+
+---------------+-------------------+
| JSON | Python |
| JSON | Python |
+===============+===================+
+===============+===================+
...
@@ -364,6 +370,8 @@ Encoders and Decoders
...
@@ -364,6 +370,8 @@ Encoders and Decoders
Supports the following objects and types by default:
Supports the following objects and types by default:
.. _py-to-json-table:
+-------------------+---------------+
+-------------------+---------------+
| Python | JSON |
| Python | JSON |
+===================+===============+
+===================+===============+
...
...
Doc/library/locale.rst
View file @
e6959648
...
@@ -59,6 +59,8 @@ The :mod:`locale` module defines the following exception and functions:
...
@@ -59,6 +59,8 @@ The :mod:`locale` module defines the following exception and functions:
Returns the database of the local conventions as a dictionary. This dictionary
Returns the database of the local conventions as a dictionary. This dictionary
has the following strings as keys:
has the following strings as keys:
.. tabularcolumns:: |l|l|L|
+----------------------+-------------------------------------+--------------------------------+
+----------------------+-------------------------------------+--------------------------------+
| Category | Key | Meaning |
| Category | Key | Meaning |
+======================+=====================================+================================+
+======================+=====================================+================================+
...
...
Doc/library/logging.rst
View file @
e6959648
...
@@ -893,6 +893,8 @@ functions.
...
@@ -893,6 +893,8 @@ functions.
The
following
keyword
arguments
are
supported
.
The
following
keyword
arguments
are
supported
.
..
tabularcolumns
::
|
l
|
L
|
+--------------+---------------------------------------------+
+--------------+---------------------------------------------+
|
Format
|
Description
|
|
Format
|
Description
|
+==============+=============================================+
+==============+=============================================+
...
...
Doc/library/socket.rst
View file @
e6959648
...
@@ -72,7 +72,7 @@ numeric address in *host* portion.
...
@@ -72,7 +72,7 @@ numeric address in *host* portion.
tuple, and the fields depend on the address type. The general tuple form is
tuple, and the fields depend on the address type. The general tuple form is
``(addr_type, v1, v2, v3 [, scope])``, where:
``(addr_type, v1, v2, v3 [, scope])``, where:
- *addr_type* is one of :const
;
`TIPC_ADDR_NAMESEQ`, :const:`TIPC_ADDR_NAME`,
- *addr_type* is one of :const
:
`TIPC_ADDR_NAMESEQ`, :const:`TIPC_ADDR_NAME`,
or :const:`TIPC_ADDR_ID`.
or :const:`TIPC_ADDR_ID`.
- *scope* is one of :const:`TIPC_ZONE_SCOPE`, :const:`TIPC_CLUSTER_SCOPE`,
- *scope* is one of :const:`TIPC_ZONE_SCOPE`, :const:`TIPC_CLUSTER_SCOPE`,
and :const:`TIPC_NODE_SCOPE`.
and :const:`TIPC_NODE_SCOPE`.
...
...
Doc/library/subprocess.rst
View file @
e6959648
...
@@ -145,6 +145,8 @@ use cases, the underlying :class:`Popen` interface can be used directly.
...
@@ -145,6 +145,8 @@ use cases, the underlying :class:`Popen` interface can be used directly.
.. versionadded:: 2.7
.. versionadded:: 2.7
..
.. warning::
.. warning::
Invoking the system shell with ``shell=True`` can be a security hazard
Invoking the system shell with ``shell=True`` can be a security hazard
...
@@ -225,7 +227,7 @@ default values. The arguments that are most commonly needed are:
...
@@ -225,7 +227,7 @@ default values. The arguments that are most commonly needed are:
When *stdout* or *stderr* are pipes and *universal_newlines* is
When *stdout* or *stderr* are pipes and *universal_newlines* is
``True`` then all line endings will be converted to ``'\n'`` as described
``True`` then all line endings will be converted to ``'\n'`` as described
for the :term:`universal newlines` `'U'`` mode argument to :func:`open`.
for the :term:`universal newlines` `
`
'U'`` mode argument to :func:`open`.
If *shell* is ``True``, the specified command will be executed through
If *shell* is ``True``, the specified command will be executed through
the shell. This can be useful if you are using Python primarily for the
the shell. This can be useful if you are using Python primarily for the
...
...
Doc/library/sys.rst
View file @
e6959648
...
@@ -302,6 +302,8 @@ always available.
...
@@ -302,6 +302,8 @@ always available.
5.2.4.2.2 of the 1999 ISO/IEC C standard [C99]_, 'Characteristics of
5.2.4.2.2 of the 1999 ISO/IEC C standard [C99]_, 'Characteristics of
floating types', for details.
floating types', for details.
.. tabularcolumns:: |l|l|L|
+---------------------+----------------+--------------------------------------------------+
+---------------------+----------------+--------------------------------------------------+
| attribute | float.h macro | explanation |
| attribute | float.h macro | explanation |
+=====================+================+==================================================+
+=====================+================+==================================================+
...
@@ -599,6 +601,8 @@ always available.
...
@@ -599,6 +601,8 @@ always available.
A struct sequence that holds information about Python's
A struct sequence that holds information about Python's
internal representation of integers. The attributes are read only.
internal representation of integers. The attributes are read only.
.. tabularcolumns:: |l|L|
+-------------------------+----------------------------------------------+
+-------------------------+----------------------------------------------+
| Attribute | Explanation |
| Attribute | Explanation |
+=========================+==============================================+
+=========================+==============================================+
...
@@ -774,7 +778,7 @@ always available.
...
@@ -774,7 +778,7 @@ always available.
independent Python files are installed; by default, this is the string
independent Python files are installed; by default, this is the string
``'/usr/local'``. This can be set at build time with the ``--prefix``
``'/usr/local'``. This can be set at build time with the ``--prefix``
argument to the :program:`configure` script. The main collection of Python
argument to the :program:`configure` script. The main collection of Python
library modules is installed in the directory :file:`{prefix}/lib/python{X.Y}`
`
library modules is installed in the directory :file:`{prefix}/lib/python{X.Y}`
while the platform independent header files (all except :file:`pyconfig.h`) are
while the platform independent header files (all except :file:`pyconfig.h`) are
stored in :file:`{prefix}/include/python{X.Y}`, where *X.Y* is the version
stored in :file:`{prefix}/include/python{X.Y}`, where *X.Y* is the version
number of Python, for example ``2.7``.
number of Python, for example ``2.7``.
...
...
Doc/library/time.rst
View file @
e6959648
...
@@ -547,8 +547,8 @@ The module defines the following functions and data items:
...
@@ -547,8 +547,8 @@ The module defines the following functions and data items:
More object-oriented interface to dates and times.
More object-oriented interface to dates and times.
Module :mod:`locale`
Module :mod:`locale`
Internationalization services. The locale setting
s can affect the return values
Internationalization services. The locale setting
affects the interpretation
for some of the functions in the :mod:`time` module
.
of many format specifiers in :func:`strftime` and :func:`strptime`
.
Module :mod:`calendar`
Module :mod:`calendar`
General calendar-related functions. :func:`timegm` is the inverse of
General calendar-related functions. :func:`timegm` is the inverse of
...
...
Doc/library/turtle.rst
View file @
e6959648
...
@@ -2173,9 +2173,11 @@ It contains:
...
@@ -2173,9 +2173,11 @@ It contains:
The demoscripts are:
The demoscripts are:
.. tabularcolumns:: |l|L|L|
+----------------+------------------------------+-----------------------+
+----------------+------------------------------+-----------------------+
| Name | Description | Features |
| Name | Description | Features |
+
----------------+------------------------------+-----------------------
+
+
================+==============================+=======================
+
| bytedesign | complex classical | :func:`tracer`, delay,|
| bytedesign | complex classical | :func:`tracer`, delay,|
| | turtlegraphics pattern | :func:`update` |
| | turtlegraphics pattern | :func:`update` |
+----------------+------------------------------+-----------------------+
+----------------+------------------------------+-----------------------+
...
...
Doc/library/unittest.rst
View file @
e6959648
...
@@ -638,7 +638,7 @@ the test unless the passed object has a certain attribute::
...
@@ -638,7 +638,7 @@ the test unless the passed object has a certain attribute::
def skipUnlessHasattr(obj, attr):
def skipUnlessHasattr(obj, attr):
if hasattr(obj, attr):
if hasattr(obj, attr):
return lambda func: func
return lambda func: func
return unittest.skip("{
0!r} doesn't have {1
!r}".format(obj, attr))
return unittest.skip("{
!r} doesn't have {
!r}".format(obj, attr))
The following decorators implement test skipping and expected failures:
The following decorators implement test skipping and expected failures:
...
@@ -660,6 +660,13 @@ The following decorators implement test skipping and expected failures:
...
@@ -660,6 +660,13 @@ The following decorators implement test skipping and expected failures:
Mark the test as an expected failure. If the test fails when run, the test
Mark the test as an expected failure. If the test fails when run, the test
is not counted as a failure.
is not counted as a failure.
.. exception:: SkipTest(reason)
This exception is raised to skip a test.
Usually you can use :meth:`TestCase.skipTest` or one of the skipping
decorators instead of raising this directly.
Skipped tests will not have :meth:`setUp` or :meth:`tearDown` run around them.
Skipped tests will not have :meth:`setUp` or :meth:`tearDown` run around them.
Skipped classes will not have :meth:`setUpClass` or :meth:`tearDownClass` run.
Skipped classes will not have :meth:`setUpClass` or :meth:`tearDownClass` run.
...
@@ -1956,7 +1963,7 @@ then you must call up to them yourself. The implementations in
...
@@ -1956,7 +1963,7 @@ then you must call up to them yourself. The implementations in
If an exception is raised during a ``setUpClass`` then the tests in the class
If an exception is raised during a ``setUpClass`` then the tests in the class
are not run and the ``tearDownClass`` is not run. Skipped classes will not
are not run and the ``tearDownClass`` is not run. Skipped classes will not
have ``setUpClass`` or ``tearDownClass`` run. If the exception is a
have ``setUpClass`` or ``tearDownClass`` run. If the exception is a
``SkipTest`
` exception then the class will be reported as having been skipped
:exc:`SkipTest
` exception then the class will be reported as having been skipped
instead of as an error.
instead of as an error.
...
@@ -1973,7 +1980,7 @@ These should be implemented as functions::
...
@@ -1973,7 +1980,7 @@ These should be implemented as functions::
If an exception is raised in a ``setUpModule`` then none of the tests in the
If an exception is raised in a ``setUpModule`` then none of the tests in the
module will be run and the ``tearDownModule`` will not be run. If the exception is a
module will be run and the ``tearDownModule`` will not be run. If the exception is a
``SkipTest`
` exception then the module will be reported as having been skipped
:exc:`SkipTest
` exception then the module will be reported as having been skipped
instead of as an error.
instead of as an error.
...
...
Doc/library/warnings.rst
View file @
e6959648
...
@@ -57,6 +57,8 @@ There are a number of built-in exceptions that represent warning categories.
...
@@ -57,6 +57,8 @@ There are a number of built-in exceptions that represent warning categories.
This categorization is useful to be able to filter out groups of warnings. The
This categorization is useful to be able to filter out groups of warnings. The
following warnings category classes are currently defined:
following warnings category classes are currently defined:
.. tabularcolumns:: |l|p{0.6\linewidth}|
+----------------------------------+-----------------------------------------------+
+----------------------------------+-----------------------------------------------+
| Class | Description |
| Class | Description |
+==================================+===============================================+
+==================================+===============================================+
...
...
Doc/library/xml.etree.elementtree.rst
View file @
e6959648
...
@@ -312,6 +312,8 @@ module. We'll be using the ``countrydata`` XML document from the
...
@@ -312,6 +312,8 @@ module. We'll be using the ``countrydata`` XML document from the
Supported XPath syntax
Supported XPath syntax
^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^
.. tabularcolumns:: |l|L|
+-----------------------+------------------------------------------------------+
+-----------------------+------------------------------------------------------+
| Syntax | Meaning |
| Syntax | Meaning |
+=======================+======================================================+
+=======================+======================================================+
...
...
Doc/reference/datamodel.rst
View file @
e6959648
...
@@ -481,6 +481,8 @@ Callable types
...
@@ -481,6 +481,8 @@ Callable types
Special attributes:
Special attributes:
.. tabularcolumns:: |l|L|l|
+-----------------------+-------------------------------+-----------+
+-----------------------+-------------------------------+-----------+
| Attribute | Meaning | |
| Attribute | Meaning | |
+=======================+===============================+===========+
+=======================+===============================+===========+
...
...
Doc/reference/expressions.rst
View file @
e6959648
...
@@ -1370,7 +1370,7 @@ groups from right to left).
...
@@ -1370,7 +1370,7 @@ groups from right to left).
| :keyword:`not` ``x`` | Boolean NOT |
| :keyword:`not` ``x`` | Boolean NOT |
+-----------------------------------------------+-------------------------------------+
+-----------------------------------------------+-------------------------------------+
| :keyword:`in`, :keyword:`not in`, | Comparisons, including membership |
| :keyword:`in`, :keyword:`not in`, | Comparisons, including membership |
| :keyword:`is`, :keyword:`is not`, ``<``, | tests and identity tests
,
|
| :keyword:`is`, :keyword:`is not`, ``<``, | tests and identity tests
|
| ``<=``, ``>``, ``>=``, ``<>``, ``!=``, ``==`` | |
| ``<=``, ``>``, ``>=``, ``<>``, ``!=``, ``==`` | |
+-----------------------------------------------+-------------------------------------+
+-----------------------------------------------+-------------------------------------+
| ``|`` | Bitwise OR |
| ``|`` | Bitwise OR |
...
...
Doc/reference/simple_stmts.rst
View file @
e6959648
...
@@ -737,7 +737,7 @@ can be found but the path exists then a value of ``None`` is
...
@@ -737,7 +737,7 @@ can be found but the path exists then a value of ``None`` is
stored
in
:
data
:`
sys
.
path_importer_cache
`
to
signify
that
an
implicit
,
stored
in
:
data
:`
sys
.
path_importer_cache
`
to
signify
that
an
implicit
,
file
-
based
finder
that
handles
modules
stored
as
individual
files
should
be
file
-
based
finder
that
handles
modules
stored
as
individual
files
should
be
used
for
that
path
.
If
the
path
does
not
exist
then
a
finder
which
always
used
for
that
path
.
If
the
path
does
not
exist
then
a
finder
which
always
returns
`
None
``
is
placed
in
the
cache
for
the
path
.
returns
`
`
None
``
is
placed
in
the
cache
for
the
path
.
..
index
::
..
index
::
single
:
loader
single
:
loader
...
...
Doc/tools/sphinxext/susp-ignored.csv
View file @
e6959648
c-api/arg,,:ref,"PyArg_ParseTuple(args, ""O|O:ref"", &object, &callback)"
c-api/arg,,:ref,"PyArg_ParseTuple(args, ""O|O:ref"", &object, &callback)"
c-api/list,,:high,list[low:high]
c-api/list,,:high,list[low:high]
c-api/list,,:high,list[low:high] = itemlist
c-api/sequence,,:i2,o[i1:i2]
c-api/sequence,,:i2,o[i1:i2]
c-api/sequence,,:i2,o[i1:i2] = v
c-api/sequence,,:i2,del o[i1:i2]
c-api/unicode,,:end,str[start:end]
c-api/unicode,,:end,str[start:end]
distutils/setupscript,,::,
distutils/setupscript,,::,
extending/embedding,,:numargs,"if(!PyArg_ParseTuple(args, "":numargs""))"
extending/embedding,,:numargs,"if(!PyArg_ParseTuple(args, "":numargs""))"
...
@@ -11,7 +8,6 @@ extending/extending,,:set,"if (PyArg_ParseTuple(args, ""O:set_callback"", &temp)
...
@@ -11,7 +8,6 @@ extending/extending,,:set,"if (PyArg_ParseTuple(args, ""O:set_callback"", &temp)
extending/extending,,:myfunction,"PyArg_ParseTuple(args, ""D:myfunction"", &c);"
extending/extending,,:myfunction,"PyArg_ParseTuple(args, ""D:myfunction"", &c);"
extending/newtypes,,:call,"if (!PyArg_ParseTuple(args, ""sss:call"", &arg1, &arg2, &arg3)) {"
extending/newtypes,,:call,"if (!PyArg_ParseTuple(args, ""sss:call"", &arg1, &arg2, &arg3)) {"
extending/windows,,:initspam,/export:initspam
extending/windows,,:initspam,/export:initspam
howto/cporting,,:add,"if (!PyArg_ParseTuple(args, ""ii:add_ints"", &one, &two))"
howto/cporting,,:encode,"if (!PyArg_ParseTuple(args, ""O:encode_object"", &myobj))"
howto/cporting,,:encode,"if (!PyArg_ParseTuple(args, ""O:encode_object"", &myobj))"
howto/cporting,,:say,"if (!PyArg_ParseTuple(args, ""U:say_hello"", &name))"
howto/cporting,,:say,"if (!PyArg_ParseTuple(args, ""U:say_hello"", &name))"
howto/curses,,:black,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and"
howto/curses,,:black,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and"
...
@@ -22,11 +18,32 @@ howto/curses,,:magenta,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:m
...
@@ -22,11 +18,32 @@ howto/curses,,:magenta,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:m
howto/curses,,:red,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and"
howto/curses,,:red,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and"
howto/curses,,:white,"7:white."
howto/curses,,:white,"7:white."
howto/curses,,:yellow,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and"
howto/curses,,:yellow,"They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and"
howto/logging,,:root,WARNING:root:Watch out!
howto/logging,,:Watch,WARNING:root:Watch out!
howto/logging,,:root,DEBUG:root:This message should go to the log file
howto/logging,,:root,INFO:root:So should this
howto/logging,,:So,INFO:root:So should this
howto/logging,,:root,"WARNING:root:And this, too"
howto/logging,,:And,"WARNING:root:And this, too"
howto/logging,,:root,INFO:root:Started
howto/logging,,:Started,INFO:root:Started
howto/logging,,:root,INFO:root:Doing something
howto/logging,,:Doing,INFO:root:Doing something
howto/logging,,:root,INFO:root:Finished
howto/logging,,:Finished,INFO:root:Finished
howto/logging,,:root,WARNING:root:Look before you leap!
howto/logging,,:Look,WARNING:root:Look before you leap!
howto/logging,,:This,DEBUG:This message should appear on the console
howto/logging,,:So,INFO:So should this
howto/logging,,:And,"WARNING:And this, too"
howto/logging,,:logger,severity:logger name:message
howto/logging,,:message,severity:logger name:message
howto/logging,,:This,DEBUG:root:This message should go to the log file
howto/regex,,::,
howto/regex,,::,
howto/regex,,:foo,(?:foo)
howto/regex,,:foo,(?:foo)
howto/urllib2,,:example,"for example ""joe@password:example.com"""
howto/urllib2,,:example,"for example ""joe@password:example.com"""
howto/webservers,,.. image:,.. image:: http.png
library/audioop,,:ipos,"# factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)],"
library/audioop,,:ipos,"# factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)],"
library/cookie,,`,!#$%&'*+-.^_`|~
library/datetime,,:MM,
library/datetime,,:MM,
library/datetime,,:SS,
library/datetime,,:SS,
library/decimal,,:optional,"trailneg:optional trailing minus indicator"
library/decimal,,:optional,"trailneg:optional trailing minus indicator"
...
@@ -40,22 +57,18 @@ library/dis,,`,TOS = `TOS`
...
@@ -40,22 +57,18 @@ library/dis,,`,TOS = `TOS`
library/doctest,,`,``factorial`` from the ``example`` module:
library/doctest,,`,``factorial`` from the ``example`` module:
library/doctest,,`,The ``example`` module
library/doctest,,`,The ``example`` module
library/doctest,,`,Using ``factorial``
library/doctest,,`,Using ``factorial``
library/exceptions,,:err,err.object[err.start:err.end]
library/functions,,:step,a[start:stop:step]
library/functions,,:step,a[start:stop:step]
library/functions,,:stop,"a[start:stop, i]"
library/functions,,:stop,"a[start:stop, i]"
library/functions,,:stop,a[start:stop:step]
library/functions,,:stop,a[start:stop:step]
library/hotshot,,:lineno,"ncalls tottime percall cumtime percall filename:lineno(function)"
library/hotshot,,:lineno,"ncalls tottime percall cumtime percall filename:lineno(function)"
library/httplib,,:port,host:port
library/httplib,,:port,host:port
library/imaplib,,:MM,"""DD-Mmm-YYYY HH:MM:SS
+HHMM""
"
library/imaplib,,:MM,"""DD-Mmm-YYYY HH:MM:SS"
library/imaplib,,:SS,"""DD-Mmm-YYYY HH:MM:SS
+HHMM""
"
library/imaplib,,:SS,"""DD-Mmm-YYYY HH:MM:SS"
library/itertools,,:stop,elements from seq[start:stop:step]
library/itertools,,:stop,elements from seq[start:stop:step]
library/itertools,,:step,elements from seq[start:stop:step]
library/itertools,,:step,elements from seq[start:stop:step]
library/linecache,,:sys,"sys:x:3:3:sys:/dev:/bin/sh"
library/linecache,,:sys,"sys:x:3:3:sys:/dev:/bin/sh"
library/logging,,:And,
library/logging.handlers,,:port,host:port
library/logging,,:package1,
library/logging,,:package2,
library/logging,,:root,
library/logging,,:This,
library/logging,,:port,host:port
library/mmap,,:i2,obj[i1:i2]
library/mmap,,:i2,obj[i1:i2]
library/multiprocessing,,:queue,">>> QueueManager.register('get_queue', callable=lambda:queue)"
library/multiprocessing,,:queue,">>> QueueManager.register('get_queue', callable=lambda:queue)"
library/multiprocessing,,`,">>> l._callmethod('__getitem__', (20,)) # equiv to `l[20]`"
library/multiprocessing,,`,">>> l._callmethod('__getitem__', (20,)) # equiv to `l[20]`"
...
@@ -65,31 +78,25 @@ library/multiprocessing,,`,# `Pool.imap()` (which will save on the amount of cod
...
@@ -65,31 +78,25 @@ library/multiprocessing,,`,# `Pool.imap()` (which will save on the amount of cod
library/multiprocessing,,`,# A test file for the `multiprocessing` package
library/multiprocessing,,`,# A test file for the `multiprocessing` package
library/multiprocessing,,`,# A test of `multiprocessing.Pool` class
library/multiprocessing,,`,# A test of `multiprocessing.Pool` class
library/multiprocessing,,`,# Add more tasks using `put()`
library/multiprocessing,,`,# Add more tasks using `put()`
library/multiprocessing,,`,# create server for a `HostManager` object
library/multiprocessing,,`,# Depends on `multiprocessing` package -- tested with `processing-0.60`
library/multiprocessing,,`,# in the original order then consider using `Pool.map()` or
library/multiprocessing,,`,# in the original order then consider using `Pool.map()` or
library/multiprocessing,,`,# Not sure if we should synchronize access to `socket.accept()` method by
library/multiprocessing,,`,# Not sure if we should synchronize access to `socket.accept()` method by
library/multiprocessing,,`,# object. (We import `multiprocessing.reduction` to enable this pickling.)
library/multiprocessing,,`,# object. (We import `multiprocessing.reduction` to enable this pickling.)
library/multiprocessing,,`,# register the Foo class; make `f()` and `g()` accessible via proxy
library/multiprocessing,,`,# register the Foo class; make `f()` and `g()` accessible via proxy
library/multiprocessing,,`,# register the Foo class; make `g()` and `_h()` accessible via proxy
library/multiprocessing,,`,# register the Foo class; make `g()` and `_h()` accessible via proxy
library/multiprocessing,,`,# register the generator function baz; use `GeneratorProxy` to make proxies
library/multiprocessing,,`,# register the generator function baz; use `GeneratorProxy` to make proxies
library/multiprocessing,,`,`Cluster` is a subclass of `SyncManager` so it allows creation of
library/multiprocessing,,`,`hostname` gives the name of the host. If hostname is not
library/multiprocessing,,`,`slots` is used to specify the number of slots for processes on
library/optparse,,:len,"del parser.rargs[:len(value)]"
library/optparse,,:len,"del parser.rargs[:len(value)]"
library/os.path,,:foo,c:foo
library/os.path,,:foo,c:foo
library/p
arser,,`,"""Make a function that raises an argument to the exponent `exp`."""
library/p
db,,:lineno,filename:lineno
library/posix,,`,"CFLAGS=""`getconf LFS_CFLAGS`"" OPT=""-g -O2 $CFLAGS"""
library/posix,,`,"CFLAGS=""`getconf LFS_CFLAGS`"" OPT=""-g -O2 $CFLAGS"""
library/profile,,:lineno,ncalls tottime percall cumtime percall filename:lineno(function)
library/profile,,:lineno,ncalls tottime percall cumtime percall filename:lineno(function)
library/profile,,:lineno,filename:lineno(function)
library/profile,,:lineno,filename:lineno(function)
library/pyexpat,,:elem1,<py:elem1 />
library/pyexpat,,:elem1,<py:elem1 />
library/pyexpat,,:py,"xmlns:py = ""http://www.python.org/ns/"">"
library/pyexpat,,:py,"xmlns:py = ""http://www.python.org/ns/"">"
library/repr,,`,"return `obj`"
library/smtplib,,:port,"as well as a regular host:port server."
library/smtplib,,:port,"as well as a regular host:port server."
library/socket,,::,'5aef:2b::8'
library/socket,,::,'5aef:2b::8'
library/sqlite3,,:memory,
library/sqlite3,,:memory,
library/sqlite3,,:
age,"select name_last, age from people where name_last=:who and age=:age
"
library/sqlite3,,:
who,"cur.execute(""select * from people where name_last=:who and age=:age"", {""who"": who, ""age"": age})
"
library/sqlite3,,:
who,"select name_last, age from people where name_last=:who and age=:age
"
library/sqlite3,,:
age,"cur.execute(""select * from people where name_last=:who and age=:age"", {""who"": who, ""age"": age})
"
library/ssl,,:My,"Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, Inc."
library/ssl,,:My,"Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, Inc."
library/ssl,,:My,"Organizational Unit Name (eg, section) []:My Group"
library/ssl,,:My,"Organizational Unit Name (eg, section) []:My Group"
library/ssl,,:myserver,"Common Name (eg, YOUR name) []:myserver.mygroup.myorganization.com"
library/ssl,,:myserver,"Common Name (eg, YOUR name) []:myserver.mygroup.myorganization.com"
...
@@ -98,8 +105,6 @@ library/ssl,,:ops,Email Address []:ops@myserver.mygroup.myorganization.com
...
@@ -98,8 +105,6 @@ library/ssl,,:ops,Email Address []:ops@myserver.mygroup.myorganization.com
library/ssl,,:Some,"Locality Name (eg, city) []:Some City"
library/ssl,,:Some,"Locality Name (eg, city) []:Some City"
library/ssl,,:US,Country Name (2 letter code) [AU]:US
library/ssl,,:US,Country Name (2 letter code) [AU]:US
library/stdtypes,,:len,s[len(s):len(s)]
library/stdtypes,,:len,s[len(s):len(s)]
library/stdtypes,,:len,s[len(s):len(s)]
library/string,,:end,s[start:end]
library/string,,:end,s[start:end]
library/string,,:end,s[start:end]
library/subprocess,,`,"output=`mycmd myarg`"
library/subprocess,,`,"output=`mycmd myarg`"
library/subprocess,,`,"output=`dmesg | grep hda`"
library/subprocess,,`,"output=`dmesg | grep hda`"
...
@@ -121,11 +126,8 @@ license,,`,THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN
...
@@ -121,11 +126,8 @@ license,,`,THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN
reference/datamodel,,:step,a[i:j:step]
reference/datamodel,,:step,a[i:j:step]
reference/datamodel,,:max,
reference/datamodel,,:max,
reference/expressions,,:index,x[index:index]
reference/expressions,,:index,x[index:index]
reference/expressions,,:datum,{key:datum...}
reference/expressions,,`,`expressions...`
reference/expressions,,`,`expressions...`
reference/grammar,,:output,#diagram:output
reference/expressions,,`,"""`"""
reference/grammar,,:rules,#diagram:rules
reference/grammar,,:token,#diagram:token
reference/grammar,,`,'`' testlist1 '`'
reference/grammar,,`,'`' testlist1 '`'
reference/lexical_analysis,,:fileencoding,# vim:fileencoding=<encoding-name>
reference/lexical_analysis,,:fileencoding,# vim:fileencoding=<encoding-name>
reference/lexical_analysis,,`,", : . ` = ;"
reference/lexical_analysis,,`,", : . ` = ;"
...
@@ -148,8 +150,6 @@ using/cmdline,,:line,action:message:category:module:line
...
@@ -148,8 +150,6 @@ using/cmdline,,:line,action:message:category:module:line
using/cmdline,,:message,action:message:category:module:line
using/cmdline,,:message,action:message:category:module:line
using/cmdline,,:module,action:message:category:module:line
using/cmdline,,:module,action:message:category:module:line
using/cmdline,,:errorhandler,:errorhandler
using/cmdline,,:errorhandler,:errorhandler
using/windows,162,`,`` this fixes syntax highlighting errors in some editors due to the \\\\ hackery
using/windows,170,`,``
whatsnew/2.0,418,:len,
whatsnew/2.0,418,:len,
whatsnew/2.3,,::,
whatsnew/2.3,,::,
whatsnew/2.3,,:config,
whatsnew/2.3,,:config,
...
@@ -163,30 +163,18 @@ whatsnew/2.4,,:System,
...
@@ -163,30 +163,18 @@ whatsnew/2.4,,:System,
whatsnew/2.5,,:memory,:memory:
whatsnew/2.5,,:memory,:memory:
whatsnew/2.5,,:step,[start:stop:step]
whatsnew/2.5,,:step,[start:stop:step]
whatsnew/2.5,,:stop,[start:stop:step]
whatsnew/2.5,,:stop,[start:stop:step]
distutils/examples,267,`,This is the description of the ``foobar`` package.
faq/programming,,:reduce,"print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,"
faq/programming,,:reduce,"print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,"
faq/programming,,:reduce,"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,"
faq/programming,,:reduce,"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,"
faq/programming,,:chr,">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr("
faq/programming,,:chr,">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr("
faq/programming,,::,for x in sequence[::-1]:
faq/programming,,::,for x in sequence[::-1]:
faq/windows,229,:EOF,@setlocal enableextensions & python -x %~f0 %* & goto :EOF
faq/windows,393,:REG,.py :REG_SZ: c:\<path to python>\python.exe -u %s %s
library/bisect,,:hi,all(val >= x for val in a[i:hi])
library/bisect,,:hi,all(val >= x for val in a[i:hi])
library/bisect,,:hi,all(val > x for val in a[i:hi])
library/bisect,,:hi,all(val > x for val in a[i:hi])
library/http.client,52,:port,host:port
library/nntplib,,:bytes,:bytes
library/nntplib,,:lines,:lines
library/nntplib,,:lines,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']"
library/nntplib,,:bytes,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']"
library/pickle,567,:memory,"conn = sqlite3.connect("":memory:"")"
library/profile,293,:lineno,"(sort by filename:lineno),"
library/socket,,::,"(10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]"
library/socket,,::,"(10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]"
library/stdtypes,,:end,s[start:end]
library/stdtypes,,:end,s[start:end]
library/stdtypes,,:end,s[start:end]
license,,`,* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
license,,`,* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
license,,`,* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
license,,`,* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
license,,`,"``Software''), to deal in the Software without restriction, including"
license,,`,"``Software''), to deal in the Software without restriction, including"
license,,`,"THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,"
license,,`,"THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,"
reference/lexical_analysis,704,`,$ ? `
whatsnew/2.7,735,:Sunday,'2009:4:Sunday'
whatsnew/2.7,735,:Sunday,'2009:4:Sunday'
whatsnew/2.7,862,::,"export PYTHONWARNINGS=all,error:::Cookie:0"
whatsnew/2.7,862,::,"export PYTHONWARNINGS=all,error:::Cookie:0"
whatsnew/2.7,862,:Cookie,"export PYTHONWARNINGS=all,error:::Cookie:0"
whatsnew/2.7,862,:Cookie,"export PYTHONWARNINGS=all,error:::Cookie:0"
...
...
Doc/tools/sphinxext/suspicious.py
View file @
e6959648
...
@@ -66,6 +66,10 @@ class Rule:
...
@@ -66,6 +66,10 @@ class Rule:
# None -> don't care
# None -> don't care
self
.
issue
=
issue
# the markup fragment that triggered this rule
self
.
issue
=
issue
# the markup fragment that triggered this rule
self
.
line
=
line
# text of the container element (single line only)
self
.
line
=
line
# text of the container element (single line only)
self
.
used
=
False
def
__repr__
(
self
):
return
'{0.docname},,{0.issue},{0.line}'
.
format
(
self
)
...
@@ -105,6 +109,12 @@ class CheckSuspiciousMarkupBuilder(Builder):
...
@@ -105,6 +109,12 @@ class CheckSuspiciousMarkupBuilder(Builder):
doctree
.
walk
(
visitor
)
doctree
.
walk
(
visitor
)
def
finish
(
self
):
def
finish
(
self
):
unused_rules
=
[
rule
for
rule
in
self
.
rules
if
not
rule
.
used
]
if
unused_rules
:
self
.
warn
(
'Found %s/%s unused rules:'
%
(
len
(
unused_rules
),
len
(
self
.
rules
)))
for
rule
in
unused_rules
:
self
.
info
(
repr
(
rule
))
return
return
def
check_issue
(
self
,
line
,
lineno
,
issue
):
def
check_issue
(
self
,
line
,
lineno
,
issue
):
...
@@ -129,6 +139,7 @@ class CheckSuspiciousMarkupBuilder(Builder):
...
@@ -129,6 +139,7 @@ class CheckSuspiciousMarkupBuilder(Builder):
if
(
rule
.
lineno
is
not
None
)
and
\
if
(
rule
.
lineno
is
not
None
)
and
\
abs
(
rule
.
lineno
-
lineno
)
>
5
:
continue
abs
(
rule
.
lineno
-
lineno
)
>
5
:
continue
# if it came this far, the rule matched
# if it came this far, the rule matched
rule
.
used
=
True
return
True
return
True
return
False
return
False
...
...
Lib/_abcoll.py
View file @
e6959648
...
@@ -74,6 +74,7 @@ class Iterator(Iterable):
...
@@ -74,6 +74,7 @@ class Iterator(Iterable):
@
abstractmethod
@
abstractmethod
def
next
(
self
):
def
next
(
self
):
'Return the next item from the iterator. When exhausted, raise StopIteration'
raise
StopIteration
raise
StopIteration
def
__iter__
(
self
):
def
__iter__
(
self
):
...
@@ -194,6 +195,7 @@ class Set(Sized, Iterable, Container):
...
@@ -194,6 +195,7 @@ class Set(Sized, Iterable, Container):
return
self
.
_from_iterable
(
value
for
value
in
other
if
value
in
self
)
return
self
.
_from_iterable
(
value
for
value
in
other
if
value
in
self
)
def
isdisjoint
(
self
,
other
):
def
isdisjoint
(
self
,
other
):
'Return True if two sets have a null intersection.'
for
value
in
other
:
for
value
in
other
:
if
value
in
self
:
if
value
in
self
:
return
False
return
False
...
@@ -259,6 +261,16 @@ Set.register(frozenset)
...
@@ -259,6 +261,16 @@ Set.register(frozenset)
class
MutableSet
(
Set
):
class
MutableSet
(
Set
):
"""A mutable set is a finite, iterable container.
This class provides concrete generic implementations of all
methods except for __contains__, __iter__, __len__,
add(), and discard().
To override the comparisons (presumably for speed, as the
semantics are fixed), all you have to do is redefine __le__ and
then the other operations will automatically follow suit.
"""
@
abstractmethod
@
abstractmethod
def
add
(
self
,
value
):
def
add
(
self
,
value
):
...
@@ -333,11 +345,20 @@ MutableSet.register(set)
...
@@ -333,11 +345,20 @@ MutableSet.register(set)
class
Mapping
(
Sized
,
Iterable
,
Container
):
class
Mapping
(
Sized
,
Iterable
,
Container
):
"""A Mapping is a generic container for associating key/value
pairs.
This class provides concrete generic implementations of all
methods except for __getitem__, __iter__, and __len__.
"""
@
abstractmethod
@
abstractmethod
def
__getitem__
(
self
,
key
):
def
__getitem__
(
self
,
key
):
raise
KeyError
raise
KeyError
def
get
(
self
,
key
,
default
=
None
):
def
get
(
self
,
key
,
default
=
None
):
'D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.'
try
:
try
:
return
self
[
key
]
return
self
[
key
]
except
KeyError
:
except
KeyError
:
...
@@ -352,23 +373,29 @@ class Mapping(Sized, Iterable, Container):
...
@@ -352,23 +373,29 @@ class Mapping(Sized, Iterable, Container):
return
True
return
True
def
iterkeys
(
self
):
def
iterkeys
(
self
):
'D.iterkeys() -> an iterator over the keys of D'
return
iter
(
self
)
return
iter
(
self
)
def
itervalues
(
self
):
def
itervalues
(
self
):
'D.itervalues() -> an iterator over the values of D'
for
key
in
self
:
for
key
in
self
:
yield
self
[
key
]
yield
self
[
key
]
def
iteritems
(
self
):
def
iteritems
(
self
):
'D.iteritems() -> an iterator over the (key, value) items of D'
for
key
in
self
:
for
key
in
self
:
yield
(
key
,
self
[
key
])
yield
(
key
,
self
[
key
])
def
keys
(
self
):
def
keys
(
self
):
"D.keys() -> list of D's keys"
return
list
(
self
)
return
list
(
self
)
def
items
(
self
):
def
items
(
self
):
"D.items() -> list of D's (key, value) pairs, as 2-tuples"
return
[(
key
,
self
[
key
])
for
key
in
self
]
return
[(
key
,
self
[
key
])
for
key
in
self
]
def
values
(
self
):
def
values
(
self
):
"D.values() -> list of D's values"
return
[
self
[
key
]
for
key
in
self
]
return
[
self
[
key
]
for
key
in
self
]
# Mappings are not hashable by default, but subclasses can change this
# Mappings are not hashable by default, but subclasses can change this
...
@@ -443,6 +470,15 @@ class ValuesView(MappingView):
...
@@ -443,6 +470,15 @@ class ValuesView(MappingView):
class
MutableMapping
(
Mapping
):
class
MutableMapping
(
Mapping
):
"""A MutableMapping is a generic container for associating
key/value pairs.
This class provides concrete generic implementations of all
methods except for __getitem__, __setitem__, __delitem__,
__iter__, and __len__.
"""
@
abstractmethod
@
abstractmethod
def
__setitem__
(
self
,
key
,
value
):
def
__setitem__
(
self
,
key
,
value
):
raise
KeyError
raise
KeyError
...
@@ -454,6 +490,9 @@ class MutableMapping(Mapping):
...
@@ -454,6 +490,9 @@ class MutableMapping(Mapping):
__marker
=
object
()
__marker
=
object
()
def
pop
(
self
,
key
,
default
=
__marker
):
def
pop
(
self
,
key
,
default
=
__marker
):
'''D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
'''
try
:
try
:
value
=
self
[
key
]
value
=
self
[
key
]
except
KeyError
:
except
KeyError
:
...
@@ -465,6 +504,9 @@ class MutableMapping(Mapping):
...
@@ -465,6 +504,9 @@ class MutableMapping(Mapping):
return
value
return
value
def
popitem
(
self
):
def
popitem
(
self
):
'''D.popitem() -> (k, v), remove and return some (key, value) pair
as a 2-tuple; but raise KeyError if D is empty.
'''
try
:
try
:
key
=
next
(
iter
(
self
))
key
=
next
(
iter
(
self
))
except
StopIteration
:
except
StopIteration
:
...
@@ -474,6 +516,7 @@ class MutableMapping(Mapping):
...
@@ -474,6 +516,7 @@ class MutableMapping(Mapping):
return
key
,
value
return
key
,
value
def
clear
(
self
):
def
clear
(
self
):
'D.clear() -> None. Remove all items from D.'
try
:
try
:
while
True
:
while
True
:
self
.
popitem
()
self
.
popitem
()
...
@@ -481,6 +524,11 @@ class MutableMapping(Mapping):
...
@@ -481,6 +524,11 @@ class MutableMapping(Mapping):
pass
pass
def
update
(
*
args
,
**
kwds
):
def
update
(
*
args
,
**
kwds
):
''' D.update([E, ]**F) -> None. Update D from mapping/iterable E and F.
If E present and has a .keys() method, does: for k in E: D[k] = E[k]
If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followed by: for k, v in F.items(): D[k] = v
'''
if
len
(
args
)
>
2
:
if
len
(
args
)
>
2
:
raise
TypeError
(
"update() takes at most 2 positional "
raise
TypeError
(
"update() takes at most 2 positional "
"arguments ({} given)"
.
format
(
len
(
args
)))
"arguments ({} given)"
.
format
(
len
(
args
)))
...
@@ -502,6 +550,7 @@ class MutableMapping(Mapping):
...
@@ -502,6 +550,7 @@ class MutableMapping(Mapping):
self
[
key
]
=
value
self
[
key
]
=
value
def
setdefault
(
self
,
key
,
default
=
None
):
def
setdefault
(
self
,
key
,
default
=
None
):
'D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D'
try
:
try
:
return
self
[
key
]
return
self
[
key
]
except
KeyError
:
except
KeyError
:
...
@@ -546,12 +595,16 @@ class Sequence(Sized, Iterable, Container):
...
@@ -546,12 +595,16 @@ class Sequence(Sized, Iterable, Container):
yield
self
[
i
]
yield
self
[
i
]
def
index
(
self
,
value
):
def
index
(
self
,
value
):
'''S.index(value) -> integer -- return first index of value.
Raises ValueError if the value is not present.
'''
for
i
,
v
in
enumerate
(
self
):
for
i
,
v
in
enumerate
(
self
):
if
v
==
value
:
if
v
==
value
:
return
i
return
i
raise
ValueError
raise
ValueError
def
count
(
self
,
value
):
def
count
(
self
,
value
):
'S.count(value) -> integer -- return number of occurrences of value'
return
sum
(
1
for
v
in
self
if
v
==
value
)
return
sum
(
1
for
v
in
self
if
v
==
value
)
Sequence
.
register
(
tuple
)
Sequence
.
register
(
tuple
)
...
@@ -562,6 +615,13 @@ Sequence.register(xrange)
...
@@ -562,6 +615,13 @@ Sequence.register(xrange)
class
MutableSequence
(
Sequence
):
class
MutableSequence
(
Sequence
):
"""All the operations on a read-only sequence.
Concrete subclasses must provide __new__ or __init__,
__getitem__, __setitem__, __delitem__, __len__, and insert().
"""
@
abstractmethod
@
abstractmethod
def
__setitem__
(
self
,
index
,
value
):
def
__setitem__
(
self
,
index
,
value
):
raise
IndexError
raise
IndexError
...
@@ -572,26 +632,36 @@ class MutableSequence(Sequence):
...
@@ -572,26 +632,36 @@ class MutableSequence(Sequence):
@
abstractmethod
@
abstractmethod
def
insert
(
self
,
index
,
value
):
def
insert
(
self
,
index
,
value
):
'S.insert(index, object) -- insert object before index'
raise
IndexError
raise
IndexError
def
append
(
self
,
value
):
def
append
(
self
,
value
):
'S.append(object) -- append object to the end of the sequence'
self
.
insert
(
len
(
self
),
value
)
self
.
insert
(
len
(
self
),
value
)
def
reverse
(
self
):
def
reverse
(
self
):
'S.reverse() -- reverse *IN PLACE*'
n
=
len
(
self
)
n
=
len
(
self
)
for
i
in
range
(
n
//
2
):
for
i
in
range
(
n
//
2
):
self
[
i
],
self
[
n
-
i
-
1
]
=
self
[
n
-
i
-
1
],
self
[
i
]
self
[
i
],
self
[
n
-
i
-
1
]
=
self
[
n
-
i
-
1
],
self
[
i
]
def
extend
(
self
,
values
):
def
extend
(
self
,
values
):
'S.extend(iterable) -- extend sequence by appending elements from the iterable'
for
v
in
values
:
for
v
in
values
:
self
.
append
(
v
)
self
.
append
(
v
)
def
pop
(
self
,
index
=-
1
):
def
pop
(
self
,
index
=-
1
):
'''S.pop([index]) -> item -- remove and return item at index (default last).
Raise IndexError if list is empty or index is out of range.
'''
v
=
self
[
index
]
v
=
self
[
index
]
del
self
[
index
]
del
self
[
index
]
return
v
return
v
def
remove
(
self
,
value
):
def
remove
(
self
,
value
):
'''S.remove(value) -- remove first occurrence of value.
Raise ValueError if the value is not present.
'''
del
self
[
self
.
index
(
value
)]
del
self
[
self
.
index
(
value
)]
def
__iadd__
(
self
,
values
):
def
__iadd__
(
self
,
values
):
...
...
Lib/idlelib/MultiCall.py
View file @
e6959648
...
@@ -171,8 +171,9 @@ class _ComplexBinder:
...
@@ -171,8 +171,9 @@ class _ComplexBinder:
break
break
ishandlerrunning
[:]
=
[]
ishandlerrunning
[:]
=
[]
# Call all functions in doafterhandler and remove them from list
# Call all functions in doafterhandler and remove them from list
while
doafterhandler
:
for
f
in
doafterhandler
:
doafterhandler
.
pop
()()
f
()
doafterhandler
[:]
=
[]
if
r
:
if
r
:
return
r
return
r
return
handler
return
handler
...
...
Lib/idlelib/NEWS.txt
View file @
e6959648
What's New in IDLE 2.7.5?
=========================
- Issue #17390: Display Python version on Idle title bar.
Initial patch by Edmond Burnett.
What's New in IDLE 2.7.4?
What's New in IDLE 2.7.4?
=========================
=========================
...
...
Lib/idlelib/PyShell.py
View file @
e6959648
...
@@ -15,6 +15,7 @@ import io
...
@@ -15,6 +15,7 @@ import io
import
linecache
import
linecache
from
code
import
InteractiveInterpreter
from
code
import
InteractiveInterpreter
from
platform
import
python_version
try
:
try
:
from
Tkinter
import
*
from
Tkinter
import
*
...
@@ -115,12 +116,13 @@ class PyShellEditorWindow(EditorWindow):
...
@@ -115,12 +116,13 @@ class PyShellEditorWindow(EditorWindow):
self
.
breakpointPath
=
os
.
path
.
join
(
idleConf
.
GetUserCfgDir
(),
self
.
breakpointPath
=
os
.
path
.
join
(
idleConf
.
GetUserCfgDir
(),
'breakpoints.lst'
)
'breakpoints.lst'
)
# whenever a file is changed, restore breakpoints
# whenever a file is changed, restore breakpoints
if
self
.
io
.
filename
:
self
.
restore_file_breaks
()
def
filename_changed_hook
(
old_hook
=
self
.
io
.
filename_change_hook
,
def
filename_changed_hook
(
old_hook
=
self
.
io
.
filename_change_hook
,
self
=
self
):
self
=
self
):
self
.
restore_file_breaks
()
self
.
restore_file_breaks
()
old_hook
()
old_hook
()
self
.
io
.
set_filename_change_hook
(
filename_changed_hook
)
self
.
io
.
set_filename_change_hook
(
filename_changed_hook
)
if
self
.
io
.
filename
:
self
.
restore_file_breaks
()
rmenu_specs
=
[
rmenu_specs
=
[
(
"Cut"
,
"<<cut>>"
,
"rmenu_check_cut"
),
(
"Cut"
,
"<<cut>>"
,
"rmenu_check_cut"
),
...
@@ -236,6 +238,9 @@ class PyShellEditorWindow(EditorWindow):
...
@@ -236,6 +238,9 @@ class PyShellEditorWindow(EditorWindow):
def
restore_file_breaks
(
self
):
def
restore_file_breaks
(
self
):
self
.
text
.
update
()
# this enables setting "BREAK" tags to be visible
self
.
text
.
update
()
# this enables setting "BREAK" tags to be visible
if
self
.
io
is
None
:
# can happen if IDLE closes due to the .update() call
return
filename
=
self
.
io
.
filename
filename
=
self
.
io
.
filename
if
filename
is
None
:
if
filename
is
None
:
return
return
...
@@ -464,6 +469,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
...
@@ -464,6 +469,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
self
.
display_no_subprocess_error
()
self
.
display_no_subprocess_error
()
return
None
return
None
self
.
transfer_path
(
with_cwd
=
with_cwd
)
self
.
transfer_path
(
with_cwd
=
with_cwd
)
console
.
stop_readline
()
# annotate restart in shell window and mark it
# annotate restart in shell window and mark it
console
.
text
.
delete
(
"iomark"
,
"end-1c"
)
console
.
text
.
delete
(
"iomark"
,
"end-1c"
)
if
was_executing
:
if
was_executing
:
...
@@ -821,7 +827,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
...
@@ -821,7 +827,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
class
PyShell
(
OutputWindow
):
class
PyShell
(
OutputWindow
):
shell_title
=
"Python Shell"
shell_title
=
"Python
"
+
python_version
()
+
"
Shell"
# Override classes
# Override classes
ColorDelegator
=
ModifiedColorDelegator
ColorDelegator
=
ModifiedColorDelegator
...
@@ -903,6 +909,7 @@ class PyShell(OutputWindow):
...
@@ -903,6 +909,7 @@ class PyShell(OutputWindow):
canceled
=
False
canceled
=
False
endoffile
=
False
endoffile
=
False
closing
=
False
closing
=
False
_stop_readline_flag
=
False
def
set_warning_stream
(
self
,
stream
):
def
set_warning_stream
(
self
,
stream
):
global
warning_stream
global
warning_stream
...
@@ -978,8 +985,7 @@ class PyShell(OutputWindow):
...
@@ -978,8 +985,7 @@ class PyShell(OutputWindow):
parent
=
self
.
text
)
parent
=
self
.
text
)
if
response
is
False
:
if
response
is
False
:
return
"cancel"
return
"cancel"
if
self
.
reading
:
self
.
stop_readline
()
self
.
top
.
quit
()
self
.
canceled
=
True
self
.
canceled
=
True
self
.
closing
=
True
self
.
closing
=
True
# Wait for poll_subprocess() rescheduling to stop
# Wait for poll_subprocess() rescheduling to stop
...
@@ -1031,6 +1037,12 @@ class PyShell(OutputWindow):
...
@@ -1031,6 +1037,12 @@ class PyShell(OutputWindow):
Tkinter
.
_default_root
=
None
# 03Jan04 KBK What's this?
Tkinter
.
_default_root
=
None
# 03Jan04 KBK What's this?
return
True
return
True
def
stop_readline
(
self
):
if
not
self
.
reading
:
# no nested mainloop to exit.
return
self
.
_stop_readline_flag
=
True
self
.
top
.
quit
()
def
readline
(
self
):
def
readline
(
self
):
save
=
self
.
reading
save
=
self
.
reading
try
:
try
:
...
@@ -1038,6 +1050,9 @@ class PyShell(OutputWindow):
...
@@ -1038,6 +1050,9 @@ class PyShell(OutputWindow):
self
.
top
.
mainloop
()
# nested mainloop()
self
.
top
.
mainloop
()
# nested mainloop()
finally
:
finally
:
self
.
reading
=
save
self
.
reading
=
save
if
self
.
_stop_readline_flag
:
self
.
_stop_readline_flag
=
False
return
""
line
=
self
.
text
.
get
(
"iomark"
,
"end-1c"
)
line
=
self
.
text
.
get
(
"iomark"
,
"end-1c"
)
if
len
(
line
)
==
0
:
# may be EOF if we quit our mainloop with Ctrl-C
if
len
(
line
)
==
0
:
# may be EOF if we quit our mainloop with Ctrl-C
line
=
"
\
n
"
line
=
"
\
n
"
...
@@ -1413,7 +1428,7 @@ def main():
...
@@ -1413,7 +1428,7 @@ def main():
global
flist
,
root
,
use_subprocess
global
flist
,
root
,
use_subprocess
use_subprocess
=
True
use_subprocess
=
True
enable_shell
=
Tru
e
enable_shell
=
Fals
e
enable_edit
=
False
enable_edit
=
False
debug
=
False
debug
=
False
cmd
=
None
cmd
=
None
...
@@ -1434,7 +1449,6 @@ def main():
...
@@ -1434,7 +1449,6 @@ def main():
enable_shell
=
True
enable_shell
=
True
if
o
==
'-e'
:
if
o
==
'-e'
:
enable_edit
=
True
enable_edit
=
True
enable_shell
=
False
if
o
==
'-h'
:
if
o
==
'-h'
:
sys
.
stdout
.
write
(
usage_msg
)
sys
.
stdout
.
write
(
usage_msg
)
sys
.
exit
()
sys
.
exit
()
...
@@ -1485,6 +1499,7 @@ def main():
...
@@ -1485,6 +1499,7 @@ def main():
edit_start
=
idleConf
.
GetOption
(
'main'
,
'General'
,
edit_start
=
idleConf
.
GetOption
(
'main'
,
'General'
,
'editor-on-startup'
,
type
=
'bool'
)
'editor-on-startup'
,
type
=
'bool'
)
enable_edit
=
enable_edit
or
edit_start
enable_edit
=
enable_edit
or
edit_start
enable_shell
=
enable_shell
or
not
enable_edit
# start editor and/or shell windows:
# start editor and/or shell windows:
root
=
Tk
(
className
=
"Idle"
)
root
=
Tk
(
className
=
"Idle"
)
...
...
Lib/idlelib/rpc.py
View file @
e6959648
...
@@ -144,7 +144,7 @@ class SocketIO(object):
...
@@ -144,7 +144,7 @@ class SocketIO(object):
def
exithook
(
self
):
def
exithook
(
self
):
"override for specific exit action"
"override for specific exit action"
os
.
_exit
()
os
.
_exit
(
0
)
def
debug
(
self
,
*
args
):
def
debug
(
self
,
*
args
):
if
not
self
.
debugging
:
if
not
self
.
debugging
:
...
...
Lib/inspect.py
View file @
e6959648
...
@@ -525,7 +525,7 @@ def findsource(object):
...
@@ -525,7 +525,7 @@ def findsource(object):
file
=
getfile
(
object
)
file
=
getfile
(
object
)
sourcefile
=
getsourcefile
(
object
)
sourcefile
=
getsourcefile
(
object
)
if
not
sourcefile
and
file
[
0
]
+
file
[
-
1
]
!=
'<>'
:
if
not
sourcefile
and
file
[
:
1
]
+
file
[
-
1
:
]
!=
'<>'
:
raise
IOError
(
'source code not available'
)
raise
IOError
(
'source code not available'
)
file
=
sourcefile
if
sourcefile
else
file
file
=
sourcefile
if
sourcefile
else
file
...
...
Lib/logging/config.py
View file @
e6959648
...
@@ -379,6 +379,12 @@ class BaseConfigurator(object):
...
@@ -379,6 +379,12 @@ class BaseConfigurator(object):
def __init__(self, config):
def __init__(self, config):
self.config = ConvertingDict(config)
self.config = ConvertingDict(config)
self.config.configurator = self
self.config.configurator = self
# Issue 12718: winpdb replaces __import__ with a Python function, which
# ends up being treated as a bound method. To avoid problems, we
# set the importer on the instance, but leave it defined in the class
# so existing code doesn'
t
break
if
type
(
__import__
)
==
types
.
FunctionType
:
self
.
importer
=
__import__
def
resolve
(
self
,
s
):
def
resolve
(
self
,
s
):
"""
"""
...
...
Lib/smtplib.py
View file @
e6959648
...
@@ -276,12 +276,12 @@ class SMTP:
...
@@ -276,12 +276,12 @@ class SMTP:
"""
"""
self.debuglevel = debuglevel
self.debuglevel = debuglevel
def _get_socket(self,
port, hos
t, timeout):
def _get_socket(self,
host, por
t, timeout):
# This makes it simpler for SMTP_SSL to use the SMTP connect code
# This makes it simpler for SMTP_SSL to use the SMTP connect code
# and just alter the socket connection bit.
# and just alter the socket connection bit.
if self.debuglevel > 0:
if self.debuglevel > 0:
print>>stderr, 'connect:', (host, port)
print>>stderr, 'connect:', (host, port)
return socket.create_connection((
port, hos
t), timeout)
return socket.create_connection((
host, por
t), timeout)
def connect(self, host='localhost', port=0):
def connect(self, host='localhost', port=0):
"""
Connect
to
a
host
on
a
given
port
.
"""
Connect
to
a
host
on
a
given
port
.
...
...
Lib/test/test_inspect.py
View file @
e6959648
...
@@ -404,6 +404,12 @@ class TestBuggyCases(GetSourceBase):
...
@@ -404,6 +404,12 @@ class TestBuggyCases(GetSourceBase):
self
.
assertEqual
(
inspect
.
findsource
(
co
),
(
lines
,
0
))
self
.
assertEqual
(
inspect
.
findsource
(
co
),
(
lines
,
0
))
self
.
assertEqual
(
inspect
.
getsource
(
co
),
lines
[
0
])
self
.
assertEqual
(
inspect
.
getsource
(
co
),
lines
[
0
])
def
test_findsource_without_filename
(
self
):
for
fname
in
[
''
,
'<string>'
]:
co
=
compile
(
'x=1'
,
fname
,
"exec"
)
self
.
assertRaises
(
IOError
,
inspect
.
findsource
,
co
)
self
.
assertRaises
(
IOError
,
inspect
.
getsource
,
co
)
class
_BrokenDataDescriptor
(
object
):
class
_BrokenDataDescriptor
(
object
):
"""
"""
...
...
Lib/test/test_kqueue.py
View file @
e6959648
...
@@ -96,11 +96,6 @@ class TestKQueue(unittest.TestCase):
...
@@ -96,11 +96,6 @@ class TestKQueue(unittest.TestCase):
pass
# FreeBSD doesn't raise an exception here
pass
# FreeBSD doesn't raise an exception here
server
,
addr
=
serverSocket
.
accept
()
server
,
addr
=
serverSocket
.
accept
()
if
sys
.
platform
.
startswith
(
"darwin"
):
flags
=
select
.
KQ_EV_ADD
|
select
.
KQ_EV_ENABLE
else
:
flags
=
0
kq
=
select
.
kqueue
()
kq
=
select
.
kqueue
()
kq2
=
select
.
kqueue
.
fromfd
(
kq
.
fileno
())
kq2
=
select
.
kqueue
.
fromfd
(
kq
.
fileno
())
...
@@ -122,11 +117,10 @@ class TestKQueue(unittest.TestCase):
...
@@ -122,11 +117,10 @@ class TestKQueue(unittest.TestCase):
kq2
.
control
([
ev
],
0
)
kq2
.
control
([
ev
],
0
)
events
=
kq
.
control
(
None
,
4
,
1
)
events
=
kq
.
control
(
None
,
4
,
1
)
events
=
[(
e
.
ident
,
e
.
filter
,
e
.
flags
)
for
e
in
events
]
events
=
set
((
e
.
ident
,
e
.
filter
)
for
e
in
events
)
events
.
sort
()
self
.
assertEqual
(
events
,
set
([
self
.
assertEqual
(
events
,
[
(
client
.
fileno
(),
select
.
KQ_FILTER_WRITE
),
(
client
.
fileno
(),
select
.
KQ_FILTER_WRITE
,
flags
),
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
)]))
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
,
flags
)])
client
.
send
(
"Hello!"
)
client
.
send
(
"Hello!"
)
server
.
send
(
"world!!!"
)
server
.
send
(
"world!!!"
)
...
@@ -140,14 +134,12 @@ class TestKQueue(unittest.TestCase):
...
@@ -140,14 +134,12 @@ class TestKQueue(unittest.TestCase):
else
:
else
:
self
.
fail
(
'timeout waiting for event notifications'
)
self
.
fail
(
'timeout waiting for event notifications'
)
events
=
[(
e
.
ident
,
e
.
filter
,
e
.
flags
)
for
e
in
events
]
events
=
set
((
e
.
ident
,
e
.
filter
)
for
e
in
events
)
events
.
sort
()
self
.
assertEqual
(
events
,
set
([
(
client
.
fileno
(),
select
.
KQ_FILTER_WRITE
),
self
.
assertEqual
(
events
,
[
(
client
.
fileno
(),
select
.
KQ_FILTER_READ
),
(
client
.
fileno
(),
select
.
KQ_FILTER_WRITE
,
flags
),
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
),
(
client
.
fileno
(),
select
.
KQ_FILTER_READ
,
flags
),
(
server
.
fileno
(),
select
.
KQ_FILTER_READ
)]))
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
,
flags
),
(
server
.
fileno
(),
select
.
KQ_FILTER_READ
,
flags
)])
# Remove completely client, and server read part
# Remove completely client, and server read part
ev
=
select
.
kevent
(
client
.
fileno
(),
ev
=
select
.
kevent
(
client
.
fileno
(),
...
@@ -164,10 +156,9 @@ class TestKQueue(unittest.TestCase):
...
@@ -164,10 +156,9 @@ class TestKQueue(unittest.TestCase):
kq
.
control
([
ev
],
0
,
0
)
kq
.
control
([
ev
],
0
,
0
)
events
=
kq
.
control
([],
4
,
0.99
)
events
=
kq
.
control
([],
4
,
0.99
)
events
=
[(
e
.
ident
,
e
.
filter
,
e
.
flags
)
for
e
in
events
]
events
=
set
((
e
.
ident
,
e
.
filter
)
for
e
in
events
)
events
.
sort
()
self
.
assertEqual
(
events
,
set
([
self
.
assertEqual
(
events
,
[
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
)]))
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
,
flags
)])
client
.
close
()
client
.
close
()
server
.
close
()
server
.
close
()
...
...
Lib/test/test_queue.py
View file @
e6959648
...
@@ -43,6 +43,9 @@ class _TriggerThread(threading.Thread):
...
@@ -43,6 +43,9 @@ class _TriggerThread(threading.Thread):
class
BlockingTestMixin
:
class
BlockingTestMixin
:
def
tearDown
(
self
):
self
.
t
=
None
def
do_blocking_test
(
self
,
block_func
,
block_args
,
trigger_func
,
trigger_args
):
def
do_blocking_test
(
self
,
block_func
,
block_args
,
trigger_func
,
trigger_args
):
self
.
t
=
_TriggerThread
(
trigger_func
,
trigger_args
)
self
.
t
=
_TriggerThread
(
trigger_func
,
trigger_args
)
self
.
t
.
start
()
self
.
t
.
start
()
...
@@ -222,7 +225,7 @@ class FailingQueue(Queue.Queue):
...
@@ -222,7 +225,7 @@ class FailingQueue(Queue.Queue):
raise
FailingQueueException
,
"You Lose"
raise
FailingQueueException
,
"You Lose"
return
Queue
.
Queue
.
_get
(
self
)
return
Queue
.
Queue
.
_get
(
self
)
class
FailingQueueTest
(
unittest
.
TestCase
,
BlockingTestMixin
):
class
FailingQueueTest
(
BlockingTestMixin
,
unittest
.
TestCase
):
def
failing_queue_test
(
self
,
q
):
def
failing_queue_test
(
self
,
q
):
if
not
q
.
empty
():
if
not
q
.
empty
():
...
...
Lib/test/test_urllib2_localnet.py
View file @
e6959648
...
@@ -489,6 +489,11 @@ class TestUrlopen(BaseTestCase):
...
@@ -489,6 +489,11 @@ class TestUrlopen(BaseTestCase):
def
test_bad_address
(
self
):
def
test_bad_address
(
self
):
# Make sure proper exception is raised when connecting to a bogus
# Make sure proper exception is raised when connecting to a bogus
# address.
# address.
# as indicated by the comment below, this might fail with some ISP,
# so we run the test only when -unetwork/-uall is specified to
# mitigate the problem a bit (see #17564)
test_support
.
requires
(
'network'
)
self
.
assertRaises
(
IOError
,
self
.
assertRaises
(
IOError
,
# Given that both VeriSign and various ISPs have in
# Given that both VeriSign and various ISPs have in
# the past or are presently hijacking various invalid
# the past or are presently hijacking various invalid
...
...
Lib/unittest/case.py
View file @
e6959648
...
@@ -26,7 +26,7 @@ class SkipTest(Exception):
...
@@ -26,7 +26,7 @@ class SkipTest(Exception):
"""
"""
Raise this exception in a test to skip it.
Raise this exception in a test to skip it.
Usually you can use Test
Result.skip
() or one of the skipping decorators
Usually you can use Test
Case.skipTest
() or one of the skipping decorators
instead of raising this directly.
instead of raising this directly.
"""
"""
pass
pass
...
@@ -150,24 +150,23 @@ class TestCase(object):
...
@@ -150,24 +150,23 @@ class TestCase(object):
should not change the signature of their __init__ method, since instances
should not change the signature of their __init__ method, since instances
of the classes are instantiated automatically by parts of the framework
of the classes are instantiated automatically by parts of the framework
in order to be run.
in order to be run.
"""
# This attribute determines which exception will be raised when
When subclassing TestCase, you can set these attributes:
# the instance's assertion methods fail; test methods raising this
* failureException: determines which exception will be raised when
# exception will be deemed to have 'failed' rather than 'errored'
the instance's assertion methods fail; test methods raising this
exception will be deemed to have 'failed' rather than 'errored'.
* longMessage: determines whether long messages (including repr of
objects used in assert methods) will be printed on failure in *addition*
to any explicit message passed.
* maxDiff: sets the maximum length of a diff in failure messages
by assert methods using difflib. It is looked up as an instance
attribute so can be configured by individual tests if required.
"""
failureException
=
AssertionError
failureException
=
AssertionError
# This attribute determines whether long messages (including repr of
# objects used in assert methods) will be printed on failure in *addition*
# to any explicit message passed.
longMessage
=
False
longMessage
=
False
# This attribute sets the maximum length of a diff in failure messages
# by assert methods using difflib. It is looked up as an instance attribute
# so can be configured by individual tests if required.
maxDiff
=
80
*
8
maxDiff
=
80
*
8
# If a string is longer than _diffThreshold, use normal comparison instead
# If a string is longer than _diffThreshold, use normal comparison instead
...
...
Misc/ACKS
View file @
e6959648
...
@@ -992,6 +992,7 @@ Monty Taylor
...
@@ -992,6 +992,7 @@ Monty Taylor
Amy Taylor
Amy Taylor
Anatoly Techtonik
Anatoly Techtonik
Mikhail Terekhov
Mikhail Terekhov
Victor Terrón
Richard M. Tew
Richard M. Tew
Tobias Thelen
Tobias Thelen
Lowe Thiderman
Lowe Thiderman
...
...
Misc/NEWS
View file @
e6959648
Python
News
Python
News
+++++++++++
+++++++++++
What
's New in Python 2.7.5?
===========================
*Release date: XXXX-XX-XX*
Core and Builtins
-----------------
Library
-------
- Issue #14254: IDLE now handles readline correctly across shell restarts.
- Issue #17614: IDLE no longer raises exception when quickly closing a file.
- Issue #13163: Rename operands in smtplib.SMTP._get_socket to correct names;
fixes otherwise misleading output in tracebacks and when when debug is on.
- Issue #6698: IDLE now opens just an editor window when configured to do so.
- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer
raises an exception.
- Issue #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo.
- Issue #17526: fix an IndexError raised while passing code without filename to
inspect.findsource(). Initial patch by Tyler Doyle.
Documentation
-------------
- Issue #15940: Specify effect of locale on time functions.
What'
s
New
in
Python
2.7.4
?
What'
s
New
in
Python
2.7.4
?
===========================
===========================
...
@@ -249,6 +283,9 @@ Core and Builtins
...
@@ -249,6 +283,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #12718: Fix interaction with winpdb overriding __import__ by setting
importer attribute on BaseConfigurator instance.
- Issue #17521: Corrected non-enabling of logger following two calls to
- Issue #17521: Corrected non-enabling of logger following two calls to
fileConfig().
fileConfig().
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment