mirror of https://github.com/python/cpython
Merged revisions 85843,85849-85850,85867,85907,85914,86134,86187,86315-86316,86390,86424-86425,86428 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85843 | georg.brandl | 2010-10-26 08:59:23 +0200 (Di, 26 Okt 2010) | 1 line Markup fix. ........ r85849 | georg.brandl | 2010-10-26 21:31:06 +0200 (Di, 26 Okt 2010) | 1 line #10200: typo. ........ r85850 | georg.brandl | 2010-10-26 21:58:11 +0200 (Di, 26 Okt 2010) | 1 line #10200: typo. ........ r85867 | georg.brandl | 2010-10-27 22:01:51 +0200 (Mi, 27 Okt 2010) | 1 line Add David. ........ r85907 | georg.brandl | 2010-10-29 06:54:13 +0200 (Fr, 29 Okt 2010) | 1 line #10222: fix for overzealous AIX compiler. ........ r85914 | georg.brandl | 2010-10-29 08:17:38 +0200 (Fr, 29 Okt 2010) | 1 line (?:...) is a non-capturing, but still grouping construct. ........ r86134 | georg.brandl | 2010-11-03 08:41:00 +0100 (Mi, 03 Nov 2010) | 1 line A newline in lineno output breaks pyframe output. ........ r86187 | georg.brandl | 2010-11-05 08:10:41 +0100 (Fr, 05 Nov 2010) | 1 line Move glossary entry to the right position and fix link. ........ r86315 | georg.brandl | 2010-11-08 12:05:18 +0100 (Mo, 08 Nov 2010) | 1 line Fix latex conversion glitch in property/feature descriptions. ........ r86316 | georg.brandl | 2010-11-08 12:08:35 +0100 (Mo, 08 Nov 2010) | 1 line Fix typo. ........ r86390 | georg.brandl | 2010-11-10 08:57:10 +0100 (Mi, 10 Nov 2010) | 1 line Fix typo. ........ r86424 | georg.brandl | 2010-11-12 07:19:48 +0100 (Fr, 12 Nov 2010) | 1 line Build a PDF of the FAQs too. ........ r86425 | georg.brandl | 2010-11-12 07:20:12 +0100 (Fr, 12 Nov 2010) | 1 line #10008: Fix duplicate index entry. ........ r86428 | georg.brandl | 2010-11-12 09:09:26 +0100 (Fr, 12 Nov 2010) | 1 line Fix weird line block in table. ........
This commit is contained in:
parent
8b63b9bb02
commit
3b85b9b477
|
@ -126,6 +126,8 @@ latex_documents = [
|
|||
'Python Tutorial', _stdauthor, 'manual'),
|
||||
('using/index', 'using.tex',
|
||||
'Python Setup and Usage', _stdauthor, 'manual'),
|
||||
('faq/index', 'faq.tex',
|
||||
'Python Frequently Asked Questions', _stdauthor, 'manual'),
|
||||
('whatsnew/' + version, 'whatsnew.tex',
|
||||
'What\'s New in Python', 'A. M. Kuchling', 'howto'),
|
||||
]
|
||||
|
|
|
@ -356,6 +356,26 @@ Glossary
|
|||
|
||||
More information can be found in :ref:`typeiter`.
|
||||
|
||||
key function
|
||||
A key function or collation function is a callable that returns a value
|
||||
used for sorting or ordering. For example, :func:`locale.strxfrm` is
|
||||
used to produce a sort key that is aware of locale specific sort
|
||||
conventions.
|
||||
|
||||
A number of tools in Python accept key functions to control how elements
|
||||
are ordered or grouped. They include :func:`min`, :func:`max`,
|
||||
:func:`sorted`, :meth:`list.sort`, :func:`heapq.nsmallest`,
|
||||
:func:`heapq.nlargest`, and :func:`itertools.groupby`.
|
||||
|
||||
There are several ways to create a key function. For example. the
|
||||
:meth:`str.lower` method can serve as a key function for case insensitive
|
||||
sorts. Alternatively, an ad-hoc key function can be built from a
|
||||
:keyword:`lambda` expression such as ``lambda r: (r[0], r[2])``. Also,
|
||||
the :mod:`operator` module provides three key function constuctors:
|
||||
:func:`~operator.attrgetter`, :func:`~operator.itemgetter`, and
|
||||
:func:`~operator.methodcaller`. See the :ref:`Sorting HOW TO
|
||||
<sortinghowto>` for examples of how to create and use key functions.
|
||||
|
||||
keyword argument
|
||||
Arguments which are preceded with a ``variable_name=`` in the call.
|
||||
The variable name designates the local name in the function to which the
|
||||
|
@ -379,7 +399,7 @@ Glossary
|
|||
:keyword:`lambda` expression such as ``lambda r: (r[0], r[2])``. Also,
|
||||
the :mod:`operator` module provides three key function constuctors:
|
||||
:func:`~operator.attrgetter`, :func:`~operator.itemgetter`, and
|
||||
:func:`~operator.methodcaller`. See the :ref:`sorting-howto` for
|
||||
:func:`~operator.methodcaller`. See the :ref:`sortinghowto` for
|
||||
examples of how to create and use key functions.
|
||||
|
||||
lambda
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.. _sorting-howto:
|
||||
.. _sortinghowto:
|
||||
|
||||
Sorting HOW TO
|
||||
**************
|
||||
|
|
|
@ -72,7 +72,6 @@ Iterator Arguments Resu
|
|||
:func:`permutations` p[, r] r-length tuples, all possible orderings, no repeated elements
|
||||
:func:`combinations` p, r r-length tuples, in sorted order, no repeated elements
|
||||
:func:`combinations_with_replacement` p, r r-length tuples, in sorted order, with repeated elements
|
||||
|
|
||||
``product('ABCD', repeat=2)`` ``AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD``
|
||||
``permutations('ABCD', 2)`` ``AB AC AD BA BC BD CA CB CD DA DB DC``
|
||||
``combinations('ABCD', 2)`` ``AB AC AD BC BD CD``
|
||||
|
|
|
@ -554,7 +554,7 @@ catalogs, and the C library's search algorithms for locating message catalogs.
|
|||
|
||||
Python applications should normally find no need to invoke these functions, and
|
||||
should use :mod:`gettext` instead. A known exception to this rule are
|
||||
applications that link use additional C libraries which internally invoke
|
||||
applications that link with additional C libraries which internally invoke
|
||||
:cfunc:`gettext` or :func:`dcgettext`. For these applications, it may be
|
||||
necessary to bind the text domain, so that the libraries can properly locate
|
||||
their message catalogs.
|
||||
|
|
|
@ -224,7 +224,7 @@ The special characters are:
|
|||
undefined.
|
||||
|
||||
``(?:...)``
|
||||
A non-grouping version of regular parentheses. Matches whatever regular
|
||||
A non-capturing version of regular parentheses. Matches whatever regular
|
||||
expression is inside the parentheses, but the substring matched by the group
|
||||
*cannot* be retrieved after performing a match or referenced later in the
|
||||
pattern.
|
||||
|
|
|
@ -146,7 +146,7 @@ string formatting behaviors using the same implementation as the built-in
|
|||
|
||||
Loop over the format_string and return an iterable of tuples
|
||||
(*literal_text*, *field_name*, *format_spec*, *conversion*). This is used
|
||||
by :meth:`vformat` to break the string in to either literal text, or
|
||||
by :meth:`vformat` to break the string into either literal text, or
|
||||
replacement fields.
|
||||
|
||||
The values in the tuple conceptually represent a span of literal text
|
||||
|
|
|
@ -164,7 +164,7 @@ the command-line options passed to :option:`-W` and calls to
|
|||
|
||||
* :exc:`BytesWarning` is ignored unless the :option:`-b` option is given once or
|
||||
twice; in this case this warning is either printed (``-b``) or turned into an
|
||||
exception (``-bb`).
|
||||
exception (``-bb``).
|
||||
|
||||
.. versionchanged:: 3.2
|
||||
:exc:`DeprecationWarning` is now ignored by default in addition to
|
||||
|
|
|
@ -52,52 +52,57 @@ for the feature and property names.
|
|||
|
||||
.. data:: feature_namespaces
|
||||
|
||||
Value: ``"http://xml.org/sax/features/namespaces"`` --- true: Perform Namespace
|
||||
processing. --- false: Optionally do not perform Namespace processing (implies
|
||||
namespace-prefixes; default). --- access: (parsing) read-only; (not parsing)
|
||||
read/write
|
||||
| value: ``"http://xml.org/sax/features/namespaces"``
|
||||
| true: Perform Namespace processing.
|
||||
| false: Optionally do not perform Namespace processing (implies
|
||||
namespace-prefixes; default).
|
||||
| access: (parsing) read-only; (not parsing) read/write
|
||||
|
||||
|
||||
.. data:: feature_namespace_prefixes
|
||||
|
||||
Value: ``"http://xml.org/sax/features/namespace-prefixes"`` --- true: Report
|
||||
the original prefixed names and attributes used for Namespace
|
||||
declarations. --- false: Do not report attributes used for Namespace
|
||||
declarations, and optionally do not report original prefixed names
|
||||
(default). --- access: (parsing) read-only; (not parsing) read/write
|
||||
| value: ``"http://xml.org/sax/features/namespace-prefixes"``
|
||||
| true: Report the original prefixed names and attributes used for Namespace
|
||||
declarations.
|
||||
| false: Do not report attributes used for Namespace declarations, and
|
||||
optionally do not report original prefixed names (default).
|
||||
| access: (parsing) read-only; (not parsing) read/write
|
||||
|
||||
|
||||
.. data:: feature_string_interning
|
||||
|
||||
Value: ``"http://xml.org/sax/features/string-interning"`` --- true: All element
|
||||
names, prefixes, attribute names, Namespace URIs, and local names are interned
|
||||
using the built-in intern function. --- false: Names are not necessarily
|
||||
interned, although they may be (default). --- access: (parsing) read-only; (not
|
||||
parsing) read/write
|
||||
| value: ``"http://xml.org/sax/features/string-interning"``
|
||||
| true: All element names, prefixes, attribute names, Namespace URIs, and
|
||||
local names are interned using the built-in intern function.
|
||||
| false: Names are not necessarily interned, although they may be (default).
|
||||
| access: (parsing) read-only; (not parsing) read/write
|
||||
|
||||
|
||||
.. data:: feature_validation
|
||||
|
||||
Value: ``"http://xml.org/sax/features/validation"`` --- true: Report all
|
||||
validation errors (implies external-general-entities and
|
||||
external-parameter-entities). --- false: Do not report validation errors. ---
|
||||
access: (parsing) read-only; (not parsing) read/write
|
||||
| value: ``"http://xml.org/sax/features/validation"``
|
||||
| true: Report all validation errors (implies external-general-entities and
|
||||
external-parameter-entities).
|
||||
| false: Do not report validation errors.
|
||||
| access: (parsing) read-only; (not parsing) read/write
|
||||
|
||||
|
||||
.. data:: feature_external_ges
|
||||
|
||||
Value: ``"http://xml.org/sax/features/external-general-entities"`` --- true:
|
||||
Include all external general (text) entities. --- false: Do not include
|
||||
external general entities. --- access: (parsing) read-only; (not parsing)
|
||||
read/write
|
||||
| value: ``"http://xml.org/sax/features/external-general-entities"``
|
||||
| true: Include all external general (text) entities.
|
||||
| false: Do not include external general entities.
|
||||
| access: (parsing) read-only; (not parsing) read/write
|
||||
|
||||
|
||||
.. data:: feature_external_pes
|
||||
|
||||
Value: ``"http://xml.org/sax/features/external-parameter-entities"`` --- true:
|
||||
Include all external parameter entities, including the external DTD subset. ---
|
||||
false: Do not include any external parameter entities, even the external DTD
|
||||
subset. --- access: (parsing) read-only; (not parsing) read/write
|
||||
| value: ``"http://xml.org/sax/features/external-parameter-entities"``
|
||||
| true: Include all external parameter entities, including the external DTD
|
||||
subset.
|
||||
| false: Do not include any external parameter entities, even the external
|
||||
DTD subset.
|
||||
| access: (parsing) read-only; (not parsing) read/write
|
||||
|
||||
|
||||
.. data:: all_features
|
||||
|
@ -107,34 +112,38 @@ for the feature and property names.
|
|||
|
||||
.. data:: property_lexical_handler
|
||||
|
||||
Value: ``"http://xml.org/sax/properties/lexical-handler"`` --- data type:
|
||||
xml.sax.sax2lib.LexicalHandler (not supported in Python 2) --- description: An
|
||||
optional extension handler for lexical events like comments. --- access:
|
||||
read/write
|
||||
| value: ``"http://xml.org/sax/properties/lexical-handler"``
|
||||
| data type: xml.sax.sax2lib.LexicalHandler (not supported in Python 2)
|
||||
| description: An optional extension handler for lexical events like
|
||||
comments.
|
||||
| access: read/write
|
||||
|
||||
|
||||
.. data:: property_declaration_handler
|
||||
|
||||
Value: ``"http://xml.org/sax/properties/declaration-handler"`` --- data type:
|
||||
xml.sax.sax2lib.DeclHandler (not supported in Python 2) --- description: An
|
||||
optional extension handler for DTD-related events other than notations and
|
||||
unparsed entities. --- access: read/write
|
||||
| value: ``"http://xml.org/sax/properties/declaration-handler"``
|
||||
| data type: xml.sax.sax2lib.DeclHandler (not supported in Python 2)
|
||||
| description: An optional extension handler for DTD-related events other
|
||||
than notations and unparsed entities.
|
||||
| access: read/write
|
||||
|
||||
|
||||
.. data:: property_dom_node
|
||||
|
||||
Value: ``"http://xml.org/sax/properties/dom-node"`` --- data type:
|
||||
org.w3c.dom.Node (not supported in Python 2) --- description: When parsing,
|
||||
the current DOM node being visited if this is a DOM iterator; when not parsing,
|
||||
the root DOM node for iteration. --- access: (parsing) read-only; (not parsing)
|
||||
read/write
|
||||
| value: ``"http://xml.org/sax/properties/dom-node"``
|
||||
| data type: org.w3c.dom.Node (not supported in Python 2)
|
||||
| description: When parsing, the current DOM node being visited if this is
|
||||
a DOM iterator; when not parsing, the root DOM node for iteration.
|
||||
| access: (parsing) read-only; (not parsing) read/write
|
||||
|
||||
|
||||
.. data:: property_xml_string
|
||||
|
||||
Value: ``"http://xml.org/sax/properties/xml-string"`` --- data type: String ---
|
||||
description: The literal string of characters that was the source for the
|
||||
current event. --- access: read-only
|
||||
| value: ``"http://xml.org/sax/properties/xml-string"``
|
||||
| data type: String
|
||||
| description: The literal string of characters that was the source for the
|
||||
current event.
|
||||
| access: read-only
|
||||
|
||||
|
||||
.. data:: all_properties
|
||||
|
|
|
@ -39,6 +39,7 @@ The module defines the following items:
|
|||
|
||||
|
||||
.. class:: ZipFile
|
||||
:noindex:
|
||||
|
||||
The class for reading and writing ZIP files. See section
|
||||
:ref:`zipfile-objects` for constructor details.
|
||||
|
|
|
@ -23,6 +23,9 @@ transliteration too.
|
|||
Permissions History
|
||||
-------------------
|
||||
|
||||
- David Malcolm was given commit access on Oct 27 2010 by GFB,
|
||||
at recommendation by Antoine Pitrou and Raymond Hettinger.
|
||||
|
||||
- Tal Einat was given commit access on Oct 4 2010 by MvL,
|
||||
for improving IDLE.
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ define lineno
|
|||
set $__p = $__p + 1
|
||||
end
|
||||
end
|
||||
printf "%d\n", $__li
|
||||
printf "%d", $__li
|
||||
end
|
||||
|
||||
# print the current frame - verbose
|
||||
|
|
Loading…
Reference in New Issue