Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

Location:
python/vendor/current/Doc/reference
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Doc/reference/compound_stmts.rst

    r2 r388  
    239239if the resulting object is "compatible" with the exception.  An object is
    240240compatible with an exception if it is the class or a base class of the exception
    241 object, a tuple containing an item compatible with the exception, or, in the
    242 (deprecated) case of string exceptions, is the raised string itself (note that
    243 the object identities must match, i.e. it must be the same string object, not
    244 just a string with the same value).
     241object, or a tuple containing an item compatible with the exception.
    245242
    246243If no except clause matches the exception, the search for an exception handler
     
    298295:keyword:`finally` clause. If the :keyword:`finally` clause raises another
    299296exception or executes a :keyword:`return` or :keyword:`break` statement, the
    300 saved exception is lost.  The exception information is not available to the
    301 program during execution of the :keyword:`finally` clause.
     297saved exception is discarded::
     298
     299    def f():
     300        try:
     301            1/0
     302        finally:
     303            return 42
     304
     305    >>> f()
     306    42
     307
     308The exception information is not available to the program during execution of
     309the :keyword:`finally` clause.
    302310
    303311.. index::
     
    334342
    335343.. productionlist::
    336    with_stmt: "with" `expression` ["as" `target`] ":" `suite`
    337 
    338 The execution of the :keyword:`with` statement proceeds as follows:
    339 
    340 #. The context expression is evaluated to obtain a context manager.
     344   with_stmt: "with" with_item ("," with_item)* ":" `suite`
     345   with_item: `expression` ["as" `target`]
     346
     347The execution of the :keyword:`with` statement with one "item" proceeds as follows:
     348
     349#. The context expression (the expression given in the :token:`with_item`) is
     350   evaluated to obtain a context manager.
     351
     352#. The context manager's :meth:`__exit__` is loaded for later use.
    341353
    342354#. The context manager's :meth:`__enter__` method is invoked.
     
    350362      returns without an error, then :meth:`__exit__` will always be called. Thus, if
    351363      an error occurs during the assignment to the target list, it will be treated the
    352       same as an error occurring within the suite would be. See step 5 below.
     364      same as an error occurring within the suite would be. See step 6 below.
    353365
    354366#. The suite is executed.
     
    368380   for the kind of exit that was taken.
    369381
     382With more than one item, the context managers are processed as if multiple
     383:keyword:`with` statements were nested::
     384
     385   with A() as a, B() as b:
     386       suite
     387
     388is equivalent to ::
     389
     390   with A() as a:
     391       with B() as b:
     392           suite
     393
    370394.. note::
    371395
     
    374398   Python 2.6.
    375399
     400.. versionchanged:: 2.7
     401   Support for multiple context expressions.
     402
    376403.. seealso::
    377404
     
    380407      statement.
    381408
     409
     410.. index::
     411   single: parameter; function definition
    382412
    383413.. _function:
     
    405435   dotted_name: `identifier` ("." `identifier`)*
    406436   parameter_list: (`defparameter` ",")*
    407                  : (  "*" `identifier` [, "**" `identifier`]
     437                 : (  "*" `identifier` ["," "**" `identifier`]
    408438                 : | "**" `identifier`
    409439                 : | `defparameter` [","] )
     
    441471   func = f1(arg)(f2(func))
    442472
    443 .. index:: triple: default; parameter; value
    444 
    445 When one or more top-level parameters have the form *parameter* ``=``
    446 *expression*, the function is said to have "default parameter values."  For a
    447 parameter with a default value, the corresponding argument may be omitted from a
    448 call, in which case the parameter's default value is substituted.  If a
     473.. index::
     474   triple: default; parameter; value
     475   single: argument; function definition
     476
     477When one or more top-level :term:`parameters <parameter>` have the form
     478*parameter* ``=`` *expression*, the function is said to have "default parameter
     479values."  For a parameter with a default value, the corresponding
     480:term:`argument` may be omitted from a call, in which
     481case the parameter's default value is substituted.  If a
    449482parameter has a default value, all following parameters must also have a default
    450483value --- this is a syntactic restriction that is not expressed by the grammar.
     
    452485**Default parameter values are evaluated when the function definition is
    453486executed.**  This means that the expression is evaluated once, when the function
    454 is defined, and that that same "pre-computed" value is used for each call.  This
     487is defined, and that the same "pre-computed" value is used for each call.  This
    455488is especially important to understand when a default parameter is a mutable
    456489object, such as a list or a dictionary: if the function modifies the object
     
    477510receiving any excess keyword arguments, defaulting to a new empty dictionary.
    478511
    479 .. index:: pair: lambda; form
     512.. index:: pair: lambda; expression
    480513
    481514It is also possible to create anonymous functions (functions not bound to a
    482 name), for immediate use in expressions.  This uses lambda forms, described in
    483 section :ref:`lambda`.  Note that the lambda form is merely a shorthand for a
     515name), for immediate use in expressions.  This uses lambda expressions, described in
     516section :ref:`lambda`.  Note that the lambda expression is merely a shorthand for a
    484517simplified function definition; a function defined in a ":keyword:`def`"
    485518statement can be passed around or assigned to another name just like a function
    486 defined by a lambda form.  The ":keyword:`def`" form is actually more powerful
     519defined by a lambda expression.  The ":keyword:`def`" form is actually more powerful
    487520since it allows the execution of multiple statements.
    488521
     
    544577.. rubric:: Footnotes
    545578
    546 .. [#] The exception is propagated to the invocation stack only if there is no
    547    :keyword:`finally` clause that negates the exception.
     579.. [#] The exception is propagated to the invocation stack unless
     580   there is a :keyword:`finally` clause which happens to raise another
     581   exception. That new exception causes the old one to be lost.
    548582
    549583.. [#] Currently, control "flows off the end" except in the case of an exception or the
  • python/vendor/current/Doc/reference/datamodel.rst

    r2 r388  
    6767   module for information on controlling the collection of cyclic garbage.
    6868   Other implementations act differently and CPython may change.
     69   Do not depend on immediate finalization of objects when they become
     70   unreachable (ex: always close files).
    6971
    7072Note that the use of the implementation's tracing or debugging facilities may
     
    410412      These represent a mutable set. They are created by the built-in :func:`set`
    411413      constructor and can be modified afterwards by several methods, such as
    412       :meth:`add`.
     414      :meth:`~set.add`.
    413415
    414416   Frozen sets
     
    479481
    480482      Special attributes:
     483
     484      .. tabularcolumns:: |l|L|l|
    481485
    482486      +-----------------------+-------------------------------+-----------+
     
    572576
    573577      .. versionchanged:: 2.6
    574          For 3.0 forward-compatibility, :attr:`im_func` is also available as
     578         For Python 3 forward-compatibility, :attr:`im_func` is also available as
    575579         :attr:`__func__`, and :attr:`im_self` as :attr:`__self__`.
    576580
     
    620624
    621625      When a user-defined method object is created by retrieving a class method object
    622       from a class or instance, its :attr:`im_self` attribute is the class itself (the
    623       same as the :attr:`im_class` attribute), and its :attr:`im_func` attribute is
    624       the function object underlying the class method.
     626      from a class or instance, its :attr:`im_self` attribute is the class itself, and
     627      its :attr:`im_func` attribute is the function object underlying the class method.
    625628
    626629      When an unbound user-defined method object is called, the underlying function
     
    659662      function`.  Such a function, when called, always returns an iterator object
    660663      which can be used to execute the body of the function:  calling the iterator's
    661       :meth:`next` method will cause the function to execute until it provides a value
     664      :meth:`~iterator.next` method will cause the function to execute until
     665      it provides a value
    662666      using the :keyword:`yield` statement.  When the function executes a
    663667      :keyword:`return` statement or falls off the end, a :exc:`StopIteration`
     
    690694      a built-in method is ``alist.append()``, assuming *alist* is a list object. In
    691695      this case, the special read-only attribute :attr:`__self__` is set to the object
    692       denoted by *list*.
     696      denoted by *alist*.
    693697
    694698   Class Types
     
    739743   Special read-only attribute: :attr:`__dict__` is the module's namespace as a
    740744   dictionary object.
     745
     746   .. impl-detail::
     747
     748      Because of the way CPython clears module dictionaries, the module
     749      dictionary will be cleared when the module falls out of scope even if the
     750      dictionary still has live references.  To avoid this, copy the dictionary
     751      or keep the module around while using its dictionary directly.
    741752
    742753   .. index::
     
    787798   transformed into an unbound user-defined method object whose :attr:`im_class`
    788799   attribute is :class:`C`. When it would yield a class method object, it is
    789    transformed into a bound user-defined method object whose :attr:`im_class`
    790    and :attr:`im_self` attributes are both :class:`C`.  When it would yield a
     800   transformed into a bound user-defined method object whose
     801   :attr:`im_self` attribute is :class:`C`.  When it would yield a
    791802   static method object, it is transformed into the object wrapped by the static
    792803   method object. See section :ref:`descriptors` for another way in which
     
    812823   Special attributes: :attr:`__name__` is the class name; :attr:`__module__` is
    813824   the module name in which the class was defined; :attr:`__dict__` is the
    814    dictionary containing the class's namespace; :attr:`__bases__` is a tuple
    815    (possibly empty or a singleton) containing the base classes, in the order of
    816    their occurrence in the base class list; :attr:`__doc__` is the class's
    817    documentation string, or None if undefined.
     825   dictionary containing the class's namespace; :attr:`~class.__bases__` is a
     826   tuple (possibly empty or a singleton) containing the base classes, in the
     827   order of their occurrence in the base class list; :attr:`__doc__` is the
     828   class's documentation string, or None if undefined.
    818829
    819830Class instances
     
    860871      single: __class__ (instance attribute)
    861872
    862    Special attributes: :attr:`__dict__` is the attribute dictionary;
    863    :attr:`__class__` is the instance's class.
     873   Special attributes: :attr:`~object.__dict__` is the attribute dictionary;
     874   :attr:`~instance.__class__` is the instance's class.
    864875
    865876Files
     
    908919      objects, code objects are immutable and contain no references (directly or
    909920      indirectly) to mutable objects.
     921
     922      .. index::
     923         single: co_argcount (code object attribute)
     924         single: co_code (code object attribute)
     925         single: co_consts (code object attribute)
     926         single: co_filename (code object attribute)
     927         single: co_firstlineno (code object attribute)
     928         single: co_flags (code object attribute)
     929         single: co_lnotab (code object attribute)
     930         single: co_name (code object attribute)
     931         single: co_names (code object attribute)
     932         single: co_nlocals (code object attribute)
     933         single: co_stacksize (code object attribute)
     934         single: co_varnames (code object attribute)
     935         single: co_cellvars (code object attribute)
     936         single: co_freevars (code object attribute)
    910937
    911938      Special read-only attributes: :attr:`co_name` gives the function name;
     
    926953      :attr:`co_flags` is an integer encoding a number of flags for the interpreter.
    927954
    928       .. index::
    929          single: co_argcount (code object attribute)
    930          single: co_code (code object attribute)
    931          single: co_consts (code object attribute)
    932          single: co_filename (code object attribute)
    933          single: co_firstlineno (code object attribute)
    934          single: co_flags (code object attribute)
    935          single: co_lnotab (code object attribute)
    936          single: co_name (code object attribute)
    937          single: co_names (code object attribute)
    938          single: co_nlocals (code object attribute)
    939          single: co_stacksize (code object attribute)
    940          single: co_varnames (code object attribute)
    941          single: co_cellvars (code object attribute)
    942          single: co_freevars (code object attribute)
    943 
    944955      .. index:: object: generator
    945956
     
    10601071         single: step (slice object attribute)
    10611072
    1062       Special read-only attributes: :attr:`start` is the lower bound; :attr:`stop` is
    1063       the upper bound; :attr:`step` is the step value; each is ``None`` if omitted.
    1064       These attributes can have any type.
     1073      Special read-only attributes: :attr:`~slice.start` is the lower bound;
     1074      :attr:`~slice.stop` is the upper bound; :attr:`~slice.step` is the step
     1075      value; each is ``None`` if omitted.  These attributes can have any type.
    10651076
    10661077      Slice objects support one method:
     
    11411152   single: class; old-style
    11421153
    1143 Old-style classes are removed in Python 3.0, leaving only the semantics of
     1154Old-style classes are removed in Python 3, leaving only the semantics of
    11441155new-style classes.
    11451156
     
    11691180object being modelled.  For example, some sequences may work well with retrieval
    11701181of individual elements, but extracting a slice may not make sense.  (One example
    1171 of this is the :class:`NodeList` interface in the W3C's Document Object Model.)
     1182of this is the :class:`~xml.dom.NodeList` interface in the W3C's Document
     1183Object Model.)
    11721184
    11731185
     
    12741286      called.
    12751287
     1288   See also the :option:`-R` command-line option.
     1289
    12761290
    12771291.. method:: object.__repr__(self)
     
    13541368
    13551369   To automatically generate ordering operations from a single root operation,
    1356    see the `Total Ordering recipe in the ASPN cookbook
    1357    <http://code.activestate.com/recipes/576529/>`_\.
     1370   see :func:`functools.total_ordering`.
    13581371
    13591372.. method:: object.__cmp__(self, other)
     
    15321545
    15331546The following methods only apply when an instance of the class containing the
    1534 method (a so-called *descriptor* class) appears in the class dictionary of
    1535 another new-style class, known as the *owner* class. In the examples below, "the
    1536 attribute" refers to the attribute whose name is the key of the property in the
    1537 owner class' ``__dict__``.  Descriptors can only be implemented as new-style
    1538 classes themselves.
     1547method (a so-called *descriptor* class) appears in an *owner* class (the
     1548descriptor must be in either the owner's class dictionary or in the class
     1549dictionary for one of its parents).  In the examples below, "the attribute"
     1550refers to the attribute whose name is the key of the property in the owner
     1551class' :attr:`__dict__`.
    15391552
    15401553
     
    16011614   obj).m()`` searches ``obj.__class__.__mro__`` for the base class ``A``
    16021615   immediately preceding ``B`` and then invokes the descriptor with the call:
    1603    ``A.__dict__['m'].__get__(obj, A)``.
     1616   ``A.__dict__['m'].__get__(obj, obj.__class__)``.
    16041617
    16051618For instance bindings, the precedence of descriptor invocation depends on the
    1606 which descriptor methods are defined.  Normally, data descriptors define both
    1607 :meth:`__get__` and :meth:`__set__`, while non-data descriptors have just the
    1608 :meth:`__get__` method.  Data descriptors always override a redefinition in an
     1619which descriptor methods are defined.  A descriptor can define any combination
     1620of :meth:`__get__`, :meth:`__set__` and :meth:`__delete__`.  If it does not
     1621define :meth:`__get__`, then accessing the attribute will return the descriptor
     1622object itself unless there is a value in the object's instance dictionary.  If
     1623the descriptor defines :meth:`__set__` and/or :meth:`__delete__`, it is a data
     1624descriptor; if it defines neither, it is a non-data descriptor.  Normally, data
     1625descriptors define both :meth:`__get__` and :meth:`__set__`, while non-data
     1626descriptors have just the :meth:`__get__` method.  Data descriptors with
     1627:meth:`__set__` and :meth:`__get__` defined always override a redefinition in an
    16091628instance dictionary.  In contrast, non-data descriptors can be overridden by
    1610 instances. [#]_
     1629instances.
    16111630
    16121631Python methods (including :func:`staticmethod` and :func:`classmethod`) are
     
    17561775property creation, proxies, frameworks, and automatic resource
    17571776locking/synchronization.
     1777
     1778
     1779Customizing instance and subclass checks
     1780----------------------------------------
     1781
     1782.. versionadded:: 2.6
     1783
     1784The following methods are used to override the default behavior of the
     1785:func:`isinstance` and :func:`issubclass` built-in functions.
     1786
     1787In particular, the metaclass :class:`abc.ABCMeta` implements these methods in
     1788order to allow the addition of Abstract Base Classes (ABCs) as "virtual base
     1789classes" to any class or type (including built-in types), including other
     1790ABCs.
     1791
     1792.. method:: class.__instancecheck__(self, instance)
     1793
     1794   Return true if *instance* should be considered a (direct or indirect)
     1795   instance of *class*. If defined, called to implement ``isinstance(instance,
     1796   class)``.
     1797
     1798
     1799.. method:: class.__subclasscheck__(self, subclass)
     1800
     1801   Return true if *subclass* should be considered a (direct or indirect)
     1802   subclass of *class*.  If defined, called to implement ``issubclass(subclass,
     1803   class)``.
     1804
     1805
     1806Note that these methods are looked up on the type (metaclass) of a class.  They
     1807cannot be defined as class methods in the actual class.  This is consistent with
     1808the lookup of special methods that are called on instances, only in this
     1809case the instance is itself a class.
     1810
     1811.. seealso::
     1812
     1813   :pep:`3119` - Introducing Abstract Base Classes
     1814      Includes the specification for customizing :func:`isinstance` and
     1815      :func:`issubclass` behavior through :meth:`~class.__instancecheck__` and
     1816      :meth:`~class.__subclasscheck__`, with motivation for this functionality
     1817      in the context of adding Abstract Base Classes (see the :mod:`abc`
     1818      module) to the language.
    17581819
    17591820
     
    17881849:meth:`values`, :meth:`items`, :meth:`has_key`, :meth:`get`, :meth:`clear`,
    17891850:meth:`setdefault`, :meth:`iterkeys`, :meth:`itervalues`, :meth:`iteritems`,
    1790 :meth:`pop`, :meth:`popitem`, :meth:`copy`, and :meth:`update` behaving similar
     1851:meth:`pop`, :meth:`popitem`, :meth:`!copy`, and :meth:`update` behaving similar
    17911852to those for Python's standard dictionary objects.  The :mod:`UserDict` module
    17921853provides a :class:`DictMixin` class to help create those methods from a base set
     
    21782239evolved, the coercion rules have become hard to document precisely; documenting
    21792240what one version of one particular implementation does is undesirable.  Instead,
    2180 here are some informal guidelines regarding coercion.  In Python 3.0, coercion
     2241here are some informal guidelines regarding coercion.  In Python 3, coercion
    21812242will not be supported.
    21822243
     
    22532314*
    22542315
    2255   In ``x * y``, if one operator is a sequence that implements sequence
     2316  In ``x * y``, if one operand is a sequence that implements sequence
    22562317  repetition, and the other is an integer (:class:`int` or :class:`long`),
    22572318  sequence repetition is invoked.
     
    22662327
    22672328  In the current implementation, the built-in numeric types :class:`int`,
    2268   :class:`long` and :class:`float` do not use coercion; the type :class:`complex`
    2269   however does use coercion for binary operators and rich comparisons, despite
    2270   the above rules.  The difference can become apparent when subclassing these
    2271   types.  Over time, the type :class:`complex` may be fixed to avoid coercion.
     2329  :class:`long`, :class:`float`, and :class:`complex` do not use coercion.
    22722330  All these types implement a :meth:`__coerce__` method, for use by the built-in
    22732331  :func:`coerce` function.
     2332
     2333  .. versionchanged:: 2.7
     2334
     2335     The complex type no longer makes implicit calls to the :meth:`__coerce__`
     2336     method for mixed-type binary arithmetic operations.
    22742337
    22752338
     
    24352498   lead to some very strange behaviour if it is handled incorrectly.
    24362499
    2437 .. [#] A descriptor can define any combination of :meth:`__get__`,
    2438    :meth:`__set__` and :meth:`__delete__`.  If it does not define :meth:`__get__`,
    2439    then accessing the attribute even on an instance will return the descriptor
    2440    object itself.  If the descriptor defines :meth:`__set__` and/or
    2441    :meth:`__delete__`, it is a data descriptor; if it defines neither, it is a
    2442    non-data descriptor.
    2443 
    24442500.. [#] For operands of the same type, it is assumed that if the non-reflected method
    24452501   (such as :meth:`__add__`) fails the operation is not supported, which is why the
  • python/vendor/current/Doc/reference/executionmodel.rst

    r2 r388  
    120120.. index:: pair: restricted; execution
    121121
    122 The built-in namespace associated with the execution of a code block is actually
     122The builtins namespace associated with the execution of a code block is actually
    123123found by looking up the name ``__builtins__`` in its global namespace; this
    124124should be a dictionary or a module (in the latter case the module's dictionary
     
    132132
    133133   Users should not touch ``__builtins__``; it is strictly an implementation
    134    detail.  Users wanting to override values in the built-in namespace should
     134   detail.  Users wanting to override values in the builtins namespace should
    135135   :keyword:`import` the :mod:`__builtin__` (no 's') module and modify its
    136136   attributes appropriately.
     
    141141imported.  The main module for a script is always called :mod:`__main__`.
    142142
    143 The global statement has the same scope as a name binding operation in the same
    144 block.  If the nearest enclosing scope for a free variable contains a global
    145 statement, the free variable is treated as a global.
     143The :keyword:`global` statement has the same scope as a name binding operation
     144in the same block.  If the nearest enclosing scope for a free variable contains
     145a global statement, the free variable is treated as a global.
    146146
    147147A class definition is an executable statement that may use and define names.
  • python/vendor/current/Doc/reference/expressions.rst

    r2 r388  
    6666   atom: `identifier` | `literal` | `enclosure`
    6767   enclosure: `parenth_form` | `list_display`
    68             : | `generator_expression` | `dict_display`
     68            : | `generator_expression` | `dict_display` | `set_display`
    6969            : | `string_conversion` | `yield_atom`
    7070
     
    9797or more underscores, it is considered a :dfn:`private name` of that class.
    9898Private names are transformed to a longer form before code is generated for
    99 them.  The transformation inserts the class name in front of the name, with
    100 leading underscores removed, and a single underscore inserted in front of the
    101 class name.  For example, the identifier ``__spam`` occurring in a class named
    102 ``Ham`` will be transformed to ``_Ham__spam``.  This transformation is
    103 independent of the syntactical context in which the identifier is used.  If the
    104 transformed name is extremely long (longer than 255 characters), implementation
    105 defined truncation may happen.  If the class name consists only of underscores,
    106 no transformation is done.
     99them.  The transformation inserts the class name, with leading underscores
     100removed and a single underscore inserted, in front of the name.  For example,
     101the identifier ``__spam`` occurring in a class named ``Ham`` will be transformed
     102to ``_Ham__spam``.  This transformation is independent of the syntactical
     103context in which the identifier is used.  If the transformed name is extremely
     104long (longer than 255 characters), implementation defined truncation may happen.
     105If the class name consists only of underscores, no transformation is done.
    107106
    108107
     
    186185   list_for: "for" `target_list` "in" `old_expression_list` [`list_iter`]
    187186   old_expression_list: `old_expression` [("," `old_expression`)+ [","]]
     187   old_expression: `or_test` | `old_lambda_expr`
    188188   list_iter: `list_for` | `list_if`
    189189   list_if: "if" `old_expression` [`list_iter`]
     
    206206
    207207
     208.. _comprehensions:
     209
     210Displays for sets and dictionaries
     211----------------------------------
     212
     213For constructing a set or a dictionary Python provides special syntax
     214called "displays", each of them in two flavors:
     215
     216* either the container contents are listed explicitly, or
     217
     218* they are computed via a set of looping and filtering instructions, called a
     219  :dfn:`comprehension`.
     220
     221Common syntax elements for comprehensions are:
     222
     223.. productionlist::
     224   comprehension: `expression` `comp_for`
     225   comp_for: "for" `target_list` "in" `or_test` [`comp_iter`]
     226   comp_iter: `comp_for` | `comp_if`
     227   comp_if: "if" `expression_nocond` [`comp_iter`]
     228
     229The comprehension consists of a single expression followed by at least one
     230:keyword:`for` clause and zero or more :keyword:`for` or :keyword:`if` clauses.
     231In this case, the elements of the new container are those that would be produced
     232by considering each of the :keyword:`for` or :keyword:`if` clauses a block,
     233nesting from left to right, and evaluating the expression to produce an element
     234each time the innermost block is reached.
     235
     236Note that the comprehension is executed in a separate scope, so names assigned
     237to in the target list don't "leak" in the enclosing scope.
     238
     239
    208240.. _genexpr:
    209241
     
    212244
    213245.. index:: pair: generator; expression
     246           object: generator
    214247
    215248A generator expression is a compact generator notation in parentheses:
    216249
    217250.. productionlist::
    218    generator_expression: "(" `expression` `genexpr_for` ")"
    219    genexpr_for: "for" `target_list` "in" `or_test` [`genexpr_iter`]
    220    genexpr_iter: `genexpr_for` | `genexpr_if`
    221    genexpr_if: "if" `old_expression` [`genexpr_iter`]
    222 
    223 .. index:: object: generator
    224 
    225 A generator expression yields a new generator object.  It consists of a single
    226 expression followed by at least one :keyword:`for` clause and zero or more
    227 :keyword:`for` or :keyword:`if` clauses.  The iterating values of the new
    228 generator are those that would be produced by considering each of the
    229 :keyword:`for` or :keyword:`if` clauses a block, nesting from left to right, and
    230 evaluating the expression to yield a value that is reached the innermost block
    231 for each iteration.
    232 
    233 Variables used in the generator expression are evaluated lazily in a separate
    234 scope when the :meth:`next` method is called for the generator object (in the
    235 same fashion as for normal generators).  However, the :keyword:`in` expression
    236 of the leftmost :keyword:`for` clause is immediately evaluated in the current
    237 scope so that an error produced by it can be seen before any other possible
     251   generator_expression: "(" `expression` `comp_for` ")"
     252
     253A generator expression yields a new generator object.  Its syntax is the same as
     254for comprehensions, except that it is enclosed in parentheses instead of
     255brackets or curly braces.
     256
     257Variables used in the generator expression are evaluated lazily when the
     258:meth:`__next__` method is called for generator object (in the same fashion as
     259normal generators).  However, the leftmost :keyword:`for` clause is immediately
     260evaluated, so that an error produced by it can be seen before any other possible
    238261error in the code that handles the generator expression.  Subsequent
    239 :keyword:`for` and :keyword:`if` clauses cannot be evaluated immediately since
    240 they may depend on the previous :keyword:`for` loop.  For example:
    241 ``(x*y for x in range(10) for y in bar(x))``.
    242 
    243 The parentheses can be omitted on calls with only one argument. See section
     262:keyword:`for` clauses cannot be evaluated immediately since they may depend on
     263the previous :keyword:`for` loop. For example: ``(x*y for x in range(10) for y
     264in bar(x))``.
     265
     266The parentheses can be omitted on calls with only one argument.  See section
    244267:ref:`calls` for the detail.
    245 
    246268
    247269.. _dict:
     
    251273
    252274.. index:: pair: dictionary; display
    253 
    254 .. index::
    255    single: key
    256    single: datum
    257    single: key/datum pair
     275           key, datum, key/datum pair
     276           object: dictionary
    258277
    259278A dictionary display is a possibly empty series of key/datum pairs enclosed in
     
    261280
    262281.. productionlist::
    263    dict_display: "{" [`key_datum_list`] "}"
     282   dict_display: "{" [`key_datum_list` | `dict_comprehension`] "}"
    264283   key_datum_list: `key_datum` ("," `key_datum`)* [","]
    265284   key_datum: `expression` ":" `expression`
    266 
    267 .. index:: object: dictionary
     285   dict_comprehension: `expression` ":" `expression` `comp_for`
    268286
    269287A dictionary display yields a new dictionary object.
    270288
    271 The key/datum pairs are evaluated from left to right to define the entries of
    272 the dictionary: each key object is used as a key into the dictionary to store
    273 the corresponding datum.
     289If a comma-separated sequence of key/datum pairs is given, they are evaluated
     290from left to right to define the entries of the dictionary: each key object is
     291used as a key into the dictionary to store the corresponding datum.  This means
     292that you can specify the same key multiple times in the key/datum list, and the
     293final dictionary's value for that key will be the last one given.
     294
     295A dict comprehension, in contrast to list and set comprehensions, needs two
     296expressions separated with a colon followed by the usual "for" and "if" clauses.
     297When the comprehension is run, the resulting key and value elements are inserted
     298in the new dictionary in the order they are produced.
    274299
    275300.. index:: pair: immutable; object
     301           hashable
    276302
    277303Restrictions on the types of the key values are listed earlier in section
     
    282308
    283309
     310.. _set:
     311
     312Set displays
     313------------
     314
     315.. index:: pair: set; display
     316           object: set
     317
     318A set display is denoted by curly braces and distinguishable from dictionary
     319displays by the lack of colons separating keys and values:
     320
     321.. productionlist::
     322   set_display: "{" (`expression_list` | `comprehension`) "}"
     323
     324A set display yields a new mutable set object, the contents being specified by
     325either a sequence of expressions or a comprehension.  When a comma-separated
     326list of expressions is supplied, its elements are evaluated from left to right
     327and added to the set object.  When a comprehension is supplied, the set is
     328constructed from the elements resulting from the comprehension.
     329
     330An empty set cannot be constructed with ``{}``; this literal constructs an empty
     331dictionary.
     332
     333
    284334.. _string-conversions:
    285335
     
    297347
    298348.. productionlist::
    299    string_conversion: "'" `expression_list` "'"
     349   string_conversion: "`" `expression_list` "`"
    300350
    301351A string conversion evaluates the contained expression list and converts the
     
    367417suspended.  The only difference is that a generator function cannot control
    368418where should the execution continue after it yields; the control is always
    369 transfered to the generator's caller.
     419transferred to the generator's caller.
    370420
    371421.. index:: object: generator
    372422
    373 The following generator's methods can be used to control the execution of a
    374 generator function:
     423
     424Generator-iterator methods
     425^^^^^^^^^^^^^^^^^^^^^^^^^^
     426
     427This subsection describes the methods of a generator iterator.  They can
     428be used to control the execution of a generator function.
     429
     430Note that calling any of the generator methods below when the generator
     431is already executing raises a :exc:`ValueError` exception.
    375432
    376433.. index:: exception: StopIteration
     434.. class:: generator
    377435
    378436
     
    388446   raised.
    389447
     448.. class:: .
    390449
    391450.. method:: generator.send(value)
     
    604663that is an expression is that expression.  The conversion of an ellipsis slice
    605664item is the built-in ``Ellipsis`` object.  The conversion of a proper slice is a
    606 slice object (see section :ref:`types`) whose :attr:`start`, :attr:`stop` and
    607 :attr:`step` attributes are the values of the expressions given as lower bound,
    608 upper bound and stride, respectively, substituting ``None`` for missing
    609 expressions.
    610 
     665slice object (see section :ref:`types`) whose :attr:`~slice.start`,
     666:attr:`~slice.stop` and :attr:`~slice.step` attributes are the values of the
     667expressions given as lower bound, upper bound and stride, respectively,
     668substituting ``None`` for missing expressions.
     669
     670
     671.. index::
     672   object: callable
     673   single: call
     674   single: argument; call semantics
    611675
    612676.. _calls:
     
    615679-----
    616680
    617 .. index:: single: call
    618 
    619 .. index:: object: callable
    620 
    621 A call calls a callable object (e.g., a function) with a possibly empty series
    622 of arguments:
     681A call calls a callable object (e.g., a :term:`function`) with a possibly empty
     682series of :term:`arguments <argument>`:
    623683
    624684.. productionlist::
     
    639699does not affect the semantics.
    640700
     701.. index::
     702   single: parameter; call semantics
     703
    641704The primary must evaluate to a callable object (user-defined functions, built-in
    642705functions, methods of built-in objects, class objects, methods of class
     
    644707define additional callable object types).  All argument expressions are
    645708evaluated before the call is attempted.  Please refer to section :ref:`function`
    646 for the syntax of formal parameter lists.
     709for the syntax of formal :term:`parameter` lists.
    647710
    648711If keyword arguments are present, they are first converted to positional
     
    669732   do not have names, even if they are 'named' for the purpose of documentation,
    670733   and which therefore cannot be supplied by keyword.  In CPython, this is the
    671    case for functions implemented in C that use :cfunc:`PyArg_ParseTuple` to
     734   case for functions implemented in C that use :c:func:`PyArg_ParseTuple` to
    672735   parse their arguments.
    673736
     
    685748there were no excess keyword arguments.
    686749
     750.. index::
     751   single: *; in function calls
     752
    687753If the syntax ``*expression`` appears in the function call, ``expression`` must
    688 evaluate to a sequence.  Elements from this sequence are treated as if they were
    689 additional positional arguments; if there are positional arguments *x1*,...,
    690 *xN*, and ``expression`` evaluates to a sequence *y1*, ..., *yM*, this is
    691 equivalent to a call with M+N positional arguments *x1*, ..., *xN*, *y1*, ...,
    692 *yM*.
     754evaluate to an iterable.  Elements from this iterable are treated as if they
     755were additional positional arguments; if there are positional arguments
     756*x1*, ..., *xN*, and ``expression`` evaluates to a sequence *y1*, ..., *yM*, this
     757is equivalent to a call with M+N positional arguments *x1*, ..., *xN*, *y1*,
     758..., *yM*.
    693759
    694760A consequence of this is that although the ``*expression`` syntax may appear
     
    711777used in the same call, so in practice this confusion does not arise.
    712778
     779.. index::
     780   single: **; in function calls
     781
    713782If the syntax ``**expression`` appears in the function call, ``expression`` must
    714783evaluate to a mapping, the contents of which are treated as additional keyword
     
    9501019counts raise a :exc:`ValueError` exception.
    9511020
     1021.. note::
     1022
     1023   In the current implementation, the right-hand operand is required
     1024   to be at most :attr:`sys.maxsize`.  If the right-hand operand is larger than
     1025   :attr:`sys.maxsize` an :exc:`OverflowError` exception is raised.
    9521026
    9531027.. _bitwise:
     
    9871061.. _comparisons:
    9881062.. _is:
    989 .. _isnot:
     1063.. _is not:
    9901064.. _in:
    991 .. _notin:
     1065.. _not in:
    9921066
    9931067Comparisons
     
    11371211   pair: Boolean; operation
    11381212
    1139 Boolean operations have the lowest priority of all Python operations:
    1140 
    1141 .. productionlist::
    1142    expression: `conditional_expression` | `lambda_form`
    1143    old_expression: `or_test` | `old_lambda_form`
    1144    conditional_expression: `or_test` ["if" `or_test` "else" `expression`]
     1213.. productionlist::
    11451214   or_test: `and_test` | `or_test` "or" `and_test`
    11461215   and_test: `not_test` | `and_test` "and" `not_test`
     
    11581227The operator :keyword:`not` yields ``True`` if its argument is false, ``False``
    11591228otherwise.
    1160 
    1161 The expression ``x if C else y`` first evaluates *C* (*not* *x*); if *C* is
    1162 true, *x* is evaluated and its value is returned; otherwise, *y* is evaluated
    1163 and its value is returned.
    1164 
    1165 .. versionadded:: 2.5
    11661229
    11671230.. index:: operator: and
     
    11841247
    11851248
     1249Conditional Expressions
     1250=======================
     1251
     1252.. versionadded:: 2.5
     1253
     1254.. index::
     1255   pair: conditional; expression
     1256   pair: ternary; operator
     1257
     1258.. productionlist::
     1259   conditional_expression: `or_test` ["if" `or_test` "else" `expression`]
     1260   expression: `conditional_expression` | `lambda_expr`
     1261
     1262Conditional expressions (sometimes called a "ternary operator") have the lowest
     1263priority of all Python operations.
     1264
     1265The expression ``x if C else y`` first evaluates the condition, *C* (*not* *x*);
     1266if *C* is true, *x* is evaluated and its value is returned; otherwise, *y* is
     1267evaluated and its value is returned.
     1268
     1269See :pep:`308` for more details about conditional expressions.
     1270
     1271
    11861272.. _lambdas:
    11871273.. _lambda:
     
    11921278.. index::
    11931279   pair: lambda; expression
    1194    pair: lambda; form
    11951280   pair: anonymous; function
    11961281
    11971282.. productionlist::
    1198    lambda_form: "lambda" [`parameter_list`]: `expression`
    1199    old_lambda_form: "lambda" [`parameter_list`]: `old_expression`
    1200 
    1201 Lambda forms (lambda expressions) have the same syntactic position as
     1283   lambda_expr: "lambda" [`parameter_list`]: `expression`
     1284   old_lambda_expr: "lambda" [`parameter_list`]: `old_expression`
     1285
     1286Lambda expressions (sometimes called lambda forms) have the same syntactic position as
    12021287expressions.  They are a shorthand to create anonymous functions; the expression
    12031288``lambda arguments: expression`` yields a function object.  The unnamed object
     
    12081293
    12091294See section :ref:`function` for the syntax of parameter lists.  Note that
    1210 functions created with lambda forms cannot contain statements.
     1295functions created with lambda expressions cannot contain statements.
    12111296
    12121297
     
    12591344.. _operator-summary:
    12601345
    1261 Summary
    1262 =======
     1346Operator precedence
     1347===================
    12631348
    12641349.. index:: pair: operator; precedence
     
    12771362| :keyword:`lambda`                             | Lambda expression                   |
    12781363+-----------------------------------------------+-------------------------------------+
     1364| :keyword:`if` -- :keyword:`else`              | Conditional expression              |
     1365+-----------------------------------------------+-------------------------------------+
    12791366| :keyword:`or`                                 | Boolean OR                          |
    12801367+-----------------------------------------------+-------------------------------------+
    12811368| :keyword:`and`                                | Boolean AND                         |
    12821369+-----------------------------------------------+-------------------------------------+
    1283 | :keyword:`not` *x*                            | Boolean NOT                         |
    1284 +-----------------------------------------------+-------------------------------------+
    1285 | :keyword:`in`, :keyword:`not` :keyword:`in`,  | Comparisons, including membership   |
    1286 | :keyword:`is`, :keyword:`is not`, ``<``,      | tests and identity tests,           |
     1370| :keyword:`not` ``x``                          | Boolean NOT                         |
     1371+-----------------------------------------------+-------------------------------------+
     1372| :keyword:`in`, :keyword:`not in`,             | Comparisons, including membership   |
     1373| :keyword:`is`, :keyword:`is not`, ``<``,      | tests and identity tests            |
    12871374| ``<=``, ``>``, ``>=``, ``<>``, ``!=``, ``==`` |                                     |
    12881375+-----------------------------------------------+-------------------------------------+
     
    12981385+-----------------------------------------------+-------------------------------------+
    12991386| ``*``, ``/``, ``//``, ``%``                   | Multiplication, division, remainder |
     1387|                                               | [#]_                                |
    13001388+-----------------------------------------------+-------------------------------------+
    13011389| ``+x``, ``-x``, ``~x``                        | Positive, negative, bitwise NOT     |
     
    13081396| ``(expressions...)``,                         | Binding or tuple display,           |
    13091397| ``[expressions...]``,                         | list display,                       |
    1310 | ``{key:datum...}``,                           | dictionary display,                 |
     1398| ``{key: value...}``,                          | dictionary display,                 |
    13111399| ```expressions...```                          | string conversion                   |
    13121400+-----------------------------------------------+-------------------------------------+
     
    13161404.. [#] In Python 2.3 and later releases, a list comprehension "leaks" the control
    13171405   variables of each ``for`` it contains into the containing scope.  However, this
    1318    behavior is deprecated, and relying on it will not work in Python 3.0
     1406   behavior is deprecated, and relying on it will not work in Python 3.
    13191407
    13201408.. [#] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be
     
    13221410   a Python float is an IEEE 754 double-precision number, in order that ``-1e-100 %
    13231411   1e100`` have the same sign as ``1e100``, the computed result is ``-1e-100 +
    1324    1e100``, which is numerically exactly equal to ``1e100``.  Function :func:`fmod`
    1325    in the :mod:`math` module returns a result whose sign matches the sign of the
     1412   1e100``, which is numerically exactly equal to ``1e100``.  The function
     1413   :func:`math.fmod` returns a result whose sign matches the sign of the
    13261414   first argument instead, and so returns ``-1e-100`` in this case. Which approach
    13271415   is more appropriate depends on the application.
     
    13361424   strings ``u"\u00C7"`` and ``u"\u0043\u0327"`` compare differently,
    13371425   even though they both represent the same unicode character (LATIN
    1338    CAPTITAL LETTER C WITH CEDILLA). To compare strings in a human
     1426   CAPITAL LETTER C WITH CEDILLA). To compare strings in a human
    13391427   recognizable way, compare using :func:`unicodedata.normalize`.
    13401428
     
    13531441   methods, or constants.  Check their documentation for more info.
    13541442
     1443.. [#] The ``%`` operator is also used for string formatting; the same
     1444   precedence applies.
     1445
    13551446.. [#] The power operator ``**`` binds less tightly than an arithmetic or
    13561447   bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``.
  • python/vendor/current/Doc/reference/index.rst

    r2 r388  
    44  The Python Language Reference
    55#################################
    6 
    7 :Release: |version|
    8 :Date: |today|
    96
    107This reference manual describes the syntax and "core semantics" of the
  • python/vendor/current/Doc/reference/introduction.rst

    r2 r388  
    6666   implementation that generates IL, and compiles Python code directly to .NET
    6767   assemblies.  It was created by Jim Hugunin, the original creator of Jython.  For
    68    more information, see `the IronPython website <http://www.ironpython.com/>`_.
     68   more information, see `the IronPython website <http://www.ironpython.net/>`_.
    6969
    7070PyPy
    71    An implementation of Python written in Python; even the bytecode interpreter is
    72    written in Python.  This is executed using CPython as the underlying
    73    interpreter.  One of the goals of the project is to encourage experimentation
    74    with the language itself by making it easier to modify the interpreter (since it
    75    is written in Python).  Additional information is available on `the PyPy
    76    project's home page <http://codespeak.net/pypy/>`_.
     71   An implementation of Python written completely in Python. It supports several
     72   advanced features not found in other implementations like stackless support
     73   and a Just in Time compiler. One of the goals of the project is to encourage
     74   experimentation with the language itself by making it easier to modify the
     75   interpreter (since it is written in Python).  Additional information is
     76   available on `the PyPy project's home page <http://pypy.org/>`_.
    7777
    7878Each of these implementations varies in some way from the language as documented
  • python/vendor/current/Doc/reference/lexical_analysis.rst

    r2 r388  
    358358
    359359.. versionchanged:: 2.5
    360    Both :keyword:`as` and :keyword:`with` are only recognized when the
    361    ``with_statement`` future feature has been enabled. It will always be enabled in
    362    Python 2.6.  See section :ref:`with` for details.  Note that using :keyword:`as`
    363    and :keyword:`with` as identifiers will always issue a warning, even when the
    364    ``with_statement`` future directive is not in effect.
     360   Using :keyword:`as` and :keyword:`with` as identifiers triggers a warning.  To
     361   use them as keywords, enable the ``with_statement`` future feature .
     362
     363.. versionchanged:: 2.6
     364    :keyword:`as` and :keyword:`with` are full keywords.
    365365
    366366
     
    387387
    388388``__*__``
    389    System-defined names.  These names are defined by the interpreter and its
    390    implementation (including the standard library); applications should not expect
    391    to define additional names using this convention.  The set of names of this
    392    class defined by Python may be extended in future versions. See section
    393    :ref:`specialnames`.
     389   System-defined names. These names are defined by the interpreter and its
     390   implementation (including the standard library).  Current system names are
     391   discussed in the :ref:`specialnames` section and elsewhere.  More will likely
     392   be defined in future versions of Python.  *Any* use of ``__*__`` names, in
     393   any context, that does not follow explicitly documented use, is subject to
     394   breakage without warning.
    394395
    395396``__*``
     
    426427   stringliteral: [`stringprefix`](`shortstring` | `longstring`)
    427428   stringprefix: "r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"
     429               : | "b" | "B" | "br" | "Br" | "bR" | "BR"
    428430   shortstring: "'" `shortstringitem`* "'" | '"' `shortstringitem`* '"'
    429431   longstring: "'''" `longstringitem`* "'''"
     
    458460Unicode character set as defined by the Unicode Consortium and ISO 10646.  Some
    459461additional escape sequences, described below, are available in Unicode strings.
    460 The two prefix characters may be combined; in this case, ``'u'`` must appear
    461 before ``'r'``.
     462A prefix of ``'b'`` or ``'B'`` is ignored in Python 2; it indicates that the
     463literal should become a bytes literal in Python 3 (e.g. when code is
     464automatically converted with 2to3).  A ``'u'`` or ``'b'`` prefix may be followed
     465by an ``'r'`` prefix.
    462466
    463467In triple-quoted strings, unescaped newlines and quotes are allowed (and are
     
    526530   Any Unicode character can be encoded this way, but characters outside the Basic
    527531   Multilingual Plane (BMP) will be encoded using a surrogate pair if Python is
    528    compiled to use 16-bit code units (the default).  Individual code units which
    529    form parts of a surrogate pair can be encoded using this escape sequence.
     532   compiled to use 16-bit code units (the default).
    530533
    531534(3)
  • python/vendor/current/Doc/reference/simple_stmts.rst

    r2 r388  
    122122  iterable with the same number of items as there are targets in the target list,
    123123  and the items are assigned, from left to right, to the corresponding targets.
    124   (This rule is relaxed as of Python 1.5; in earlier versions, the object had to
    125   be a tuple.  Since strings are sequences, an assignment like ``a, b = "xy"`` is
    126   now legal as long as the string has the right length.)
    127124
    128125Assignment of an object to a single target is recursively defined as follows.
     
    356353
    357354Deletion is recursively defined very similar to the way assignment is defined.
    358 Rather that spelling it out in full details, here are some hints.
     355Rather than spelling it out in full details, here are some hints.
    359356
    360357Deletion of a target list recursively deletes each target, from left to right.
     
    515512clauses to execute.
    516513
     514For full details of :keyword:`yield` semantics, refer to the :ref:`yieldexpr`
     515section.
     516
    517517.. note::
    518518
     
    710710:attr:`__path__` attribute from the parent package (everything up to the last
    711711dot in the name of the module being imported). If a finder can find the module
    712 it returns a :term:`loader` (discussed later) or returns :keyword:`None`.
     712it returns a :term:`loader` (discussed later) or returns ``None``.
    713713
    714714.. index::
     
    737737:exc:`ImportError`. If a finder is returned then it is cached in
    738738:data:`sys.path_importer_cache` and then used for that path entry. If no finder
    739 can be found but the path exists then a value of :keyword:`None` is
     739can be found but the path exists then a value of ``None`` is
    740740stored in :data:`sys.path_importer_cache` to signify that an implicit,
    741741file-based finder that handles modules stored as individual files should be
    742742used for that path. If the path does not exist then a finder which always
    743 returns :keyword:`None` is placed in the cache for the path.
     743returns ``None`` is placed in the cache for the path.
    744744
    745745.. index::
     
    837837So if you execute ``from . import mod`` from a module in the ``pkg`` package
    838838then you will end up importing ``pkg.mod``. If you execute ``from ..subpkg2
    839 imprt mod`` from within ``pkg.subpkg1`` you will import ``pkg.subpkg2.mod``.
     839import mod`` from within ``pkg.subpkg1`` you will import ``pkg.subpkg2.mod``.
    840840The specification for relative imports is contained within :pep:`328`.
    841841
    842 
    843 .. index:: builtin: __import__
    844 
    845 The built-in function :func:`__import__` is provided to support applications
    846 that determine which modules need to be loaded dynamically; refer to
    847 :ref:`built-in-funcs` for additional information.
     842:func:`importlib.import_module` is provided to support applications that
     843determine which modules need to be loaded dynamically.
    848844
    849845
     
    986982
    987983This statement supports dynamic execution of Python code.  The first expression
    988 should evaluate to either a string, an open file object, or a code object.  If
    989 it is a string, the string is parsed as a suite of Python statements which is
    990 then executed (unless a syntax error occurs). [#]_  If it is an open file, the file
    991 is parsed until EOF and executed.  If it is a code object, it is simply
    992 executed.  In all cases, the code that's executed is expected to be valid as
    993 file input (see section :ref:`file-input`).  Be aware that the
     984should evaluate to either a Unicode string, a *Latin-1* encoded string, an open
     985file object, a code object, or a tuple.  If it is a string, the string is parsed
     986as a suite of Python statements which is then executed (unless a syntax error
     987occurs). [#]_ If it is an open file, the file is parsed until EOF and executed.
     988If it is a code object, it is simply executed.  For the interpretation of a
     989tuple, see below.  In all cases, the code that's executed is expected to be
     990valid as file input (see section :ref:`file-input`).  Be aware that the
    994991:keyword:`return` and :keyword:`yield` statements may not be used outside of
    995992function definitions even within the context of code passed to the
     
    997994
    998995In all cases, if the optional parts are omitted, the code is executed in the
    999 current scope.  If only the first expression after :keyword:`in` is specified,
     996current scope.  If only the first expression after ``in`` is specified,
    1000997it should be a dictionary, which will be used for both the global and the local
    1001998variables.  If two expressions are given, they are used for the global and local
    1002999variables, respectively. If provided, *locals* can be any mapping object.
     1000Remember that at module level, globals and locals are the same dictionary. If
     1001two separate objects are given as *globals* and *locals*, the code will be
     1002executed as if it were embedded in a class definition.
     1003
     1004The first expression may also be a tuple of length 2 or 3.  In this case, the
     1005optional parts must be omitted.  The form ``exec(expr, globals)`` is equivalent
     1006to ``exec expr in globals``, while the form ``exec(expr, globals, locals)`` is
     1007equivalent to ``exec expr in globals, locals``.  The tuple form of ``exec``
     1008provides compatibility with Python 3, where ``exec`` is a function rather than
     1009a statement.
    10031010
    10041011.. versionchanged:: 2.4
     
    10291036
    10301037.. [#] Note that the parser only accepts the Unix-style end of line convention.
    1031        If you are reading the code from a file, make sure to use universal
    1032        newline mode to convert Windows or Mac-style newlines.
     1038       If you are reading the code from a file, make sure to use
     1039       :term:`universal newlines` mode to convert Windows or Mac-style newlines.
Note: See TracChangeset for help on using the changeset viewer.