]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 84249,84264,84326-84327,84407,84476,84480-84482,84484,84530-84531...
authorGeorg Brandl <georg@python.org>
Wed, 6 Oct 2010 08:54:16 +0000 (08:54 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 6 Oct 2010 08:54:16 +0000 (08:54 +0000)
svn+ssh://svn.python.org/python/branches/py3k

........
  r84249 | georg.brandl | 2010-08-22 01:20:01 +0200 (So, 22 Aug 2010) | 1 line

  Remove usage of rexec in tkinter demo.
........
  r84264 | georg.brandl | 2010-08-22 22:23:38 +0200 (So, 22 Aug 2010) | 1 line

  #9649: fix default value description.
........
  r84326 | georg.brandl | 2010-08-26 16:30:15 +0200 (Do, 26 Aug 2010) | 1 line

  #9689: add links from overview to in-depth class API descriptions.
........
  r84327 | georg.brandl | 2010-08-26 16:30:56 +0200 (Do, 26 Aug 2010) | 1 line

  #9681: typo.
........
  r84407 | georg.brandl | 2010-09-01 23:02:50 +0200 (Mi, 01 Sep 2010) | 1 line

  #9677: fix link.
........
  r84476 | georg.brandl | 2010-09-04 00:14:52 +0200 (Sa, 04 Sep 2010) | 1 line

  Use tabs consistently.
........
  r84480 | georg.brandl | 2010-09-04 00:33:27 +0200 (Sa, 04 Sep 2010) | 1 line

  More inclusive title.
........
  r84481 | georg.brandl | 2010-09-04 00:36:22 +0200 (Sa, 04 Sep 2010) | 1 line

  #9767: doctest run over json docs.
........
  r84482 | georg.brandl | 2010-09-04 00:40:02 +0200 (Sa, 04 Sep 2010) | 1 line

  #9760: clarify what context expression is.
........
  r84484 | georg.brandl | 2010-09-04 00:49:27 +0200 (Sa, 04 Sep 2010) | 1 line

  Fix missing word.
........
  r84530 | georg.brandl | 2010-09-05 19:07:12 +0200 (So, 05 Sep 2010) | 1 line

  #9747: fix copy-paste error in getresgid() doc.
........
  r84531 | georg.brandl | 2010-09-05 19:09:18 +0200 (So, 05 Sep 2010) | 1 line

  #9776: fix some spacing.
........
  r84553 | georg.brandl | 2010-09-06 08:49:07 +0200 (Mo, 06 Sep 2010) | 1 line

  #9780: both { and } are not valid fill characters.
........
  r84619 | georg.brandl | 2010-09-08 12:43:45 +0200 (Mi, 08 Sep 2010) | 1 line

  Add Lukasz.
........
  r84684 | georg.brandl | 2010-09-10 22:43:53 +0200 (Fr, 10 Sep 2010) | 1 line

  release() is probably not the most important method
........
  r84915 | georg.brandl | 2010-09-20 08:27:02 +0200 (Mo, 20 Sep 2010) | 1 line

  Fix typo.
........
  r84916 | georg.brandl | 2010-09-20 08:29:01 +0200 (Mo, 20 Sep 2010) | 1 line

  Mention % as string formatting.
........

15 files changed:
Demo/tkinter/guido/ss1.py
Doc/conf.py
Doc/library/json.rst
Doc/library/multiprocessing.rst
Doc/library/string.rst
Doc/library/subprocess.rst
Doc/library/threading.rst
Doc/reference/compound_stmts.rst
Doc/reference/expressions.rst
Doc/tools/sphinxext/indexcontent.html
Doc/tutorial/datastructures.rst
Doc/using/index.rst
Makefile.pre.in
Misc/developers.txt
Modules/fcntlmodule.c

index 6a7aefcccaf15c5f890f3953f33e05236ccec0d7..a6c8c2181edcecc358629acddea666361d9d31d1 100644 (file)
@@ -4,7 +4,6 @@ import os
 import re
 import sys
 import cgi
-import rexec
 from xml.parsers import expat
 
 LEFT, CENTER, RIGHT = "LEFT", "CENTER", "RIGHT"
@@ -33,16 +32,16 @@ class Sheet:
 
     def __init__(self):
         self.cells = {} # {(x, y): cell, ...}
-        self.rexec = rexec.RExec()
-        m = self.rexec.add_module('__main__')
-        m.cell = self.cellvalue
-        m.cells = self.multicellvalue
-        m.sum = sum
+        self.ns = dict(
+            cell = self.cellvalue,
+            cells = self.multicellvalue,
+            sum = sum,
+        )
 
     def cellvalue(self, x, y):
         cell = self.getcell(x, y)
         if hasattr(cell, 'recalc'):
-            return cell.recalc(self.rexec)
+            return cell.recalc(self.ns)
         else:
             return cell
 
@@ -144,7 +143,7 @@ class Sheet:
         self.reset()
         for cell in self.cells.values():
             if hasattr(cell, 'recalc'):
-                cell.recalc(self.rexec)
+                cell.recalc(self.ns)
 
     def display(self):
         maxx, maxy = self.getsize()
@@ -164,7 +163,7 @@ class Sheet:
             if x <= 0 or y <= 0:
                 continue
             if hasattr(cell, 'recalc'):
-                cell.recalc(self.rexec)
+                cell.recalc(self.ns)
             if hasattr(cell, 'format'):
                 text, alignment = cell.format()
                 assert isinstance(text, str)
@@ -317,7 +316,7 @@ class BaseCell:
     Subclasses may but needn't provide the following APIs:
 
     cell.reset() -- prepare for recalculation
-    cell.recalc(rexec) -> value -- recalculate formula
+    cell.recalc(ns) -> value -- recalculate formula
     cell.format() -> (value, alignment) -- return formatted value
     cell.xml() -> string -- return XML
     """
@@ -331,7 +330,7 @@ class NumericCell(BaseCell):
         self.fmt = fmt
         self.alignment = alignment
 
-    def recalc(self, rexec):
+    def recalc(self, ns):
         return self.value
 
     def format(self):
@@ -372,7 +371,7 @@ class StringCell(BaseCell):
         self.fmt = fmt
         self.alignment = alignment
 
-    def recalc(self, rexec):
+    def recalc(self, ns):
         return self.text
 
     def format(self):
@@ -398,13 +397,11 @@ class FormulaCell(BaseCell):
     def reset(self):
         self.value = None
 
-    def recalc(self, rexec):
+    def recalc(self, ns):
         if self.value is None:
             try:
                 # A hack to evaluate expressions using true division
-                rexec.r_exec("from __future__ import division\n" +
-                             "__value__ = eval(%s)" % repr(self.translated))
-                self.value = rexec.r_eval("__value__")
+                self.value = eval(self.translated, ns)
             except:
                 exc = sys.exc_info()[0]
                 if hasattr(exc, "__name__"):
index 9603b4b0e76bc3f6b884374741dbc7131e04644a..6a04a45c26efc30bc199411a6c9cb8a99ebbc755 100644 (file)
@@ -128,7 +128,7 @@ latex_documents = [
     ('tutorial/index', 'tutorial.tex',
      'Python Tutorial', _stdauthor, 'manual'),
     ('using/index', 'using.tex',
-     'Python Setup', _stdauthor, 'manual'),
+     'Python Setup and Usage', _stdauthor, 'manual'),
     ('whatsnew/' + version, 'whatsnew.tex',
      'What\'s New in Python', 'A. M. Kuchling', 'howto'),
 ]
index e1f5cf2a17c0465defb672d0a415fc303b4eefe1..3b203a26dfcc6e2f87d35fb3a84aa35c96f61d61 100644 (file)
@@ -82,12 +82,12 @@ Extending :class:`JSONEncoder`::
     ...             return [obj.real, obj.imag]
     ...         return json.JSONEncoder.default(self, obj)
     ...
-    >>> dumps(2 + 1j, cls=ComplexEncoder)
+    >>> json.dumps(2 + 1j, cls=ComplexEncoder)
     '[2.0, 1.0]'
     >>> ComplexEncoder().encode(2 + 1j)
     '[2.0, 1.0]'
     >>> list(ComplexEncoder().iterencode(2 + 1j))
-    ['[', '2.0', ', ', '1.0', ']']
+    ['[2.0', ', 1.0', ']']
 
 
 .. highlight:: none
@@ -339,7 +339,7 @@ Encoders and decoders
    encoders and decoders.  Otherwise, it will be a :exc:`ValueError` to encode
    such floats.
 
-   If *sort_keys* is ``True`` (the default), then the output of dictionaries
+   If *sort_keys* is ``True`` (default ``False``), then the output of dictionaries
    will be sorted by key; this is useful for regression tests to ensure that
    JSON serializations can be compared on a day-to-day basis.
 
@@ -373,7 +373,7 @@ Encoders and decoders
                 pass
             else:
                 return list(iterable)
-            return JSONEncoder.default(self, o)
+            return json.JSONEncoder.default(self, o)
 
 
    .. method:: encode(o)
@@ -381,7 +381,7 @@ Encoders and decoders
       Return a JSON string representation of a Python data structure, *o*.  For
       example::
 
-        >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
+        >>> json.JSONEncoder().encode({"foo": ["bar", "baz"]})
         '{"foo": ["bar", "baz"]}'
 
 
@@ -390,5 +390,5 @@ Encoders and decoders
       Encode the given object, *o*, and yield each string representation as
       available.  For example::
 
-            for chunk in JSONEncoder().iterencode(bigobject):
+            for chunk in json.JSONEncoder().iterencode(bigobject):
                 mysocket.write(chunk)
index bd79a3e76e1c314e9c3088c446a95fdd252ecf68..27b4c9075314a8d48670d094b38a0a57fe600baf 100644 (file)
@@ -2210,8 +2210,8 @@ Synchronization types like locks, conditions and queues:
 .. literalinclude:: ../includes/mp_synchronize.py
 
 
-An showing how to use queues to feed tasks to a collection of worker process and
-collect the results:
+An example showing how to use queues to feed tasks to a collection of worker
+process and collect the results:
 
 .. literalinclude:: ../includes/mp_workers.py
 
index dd04e3293fa0e5785684d4b4e06745cf93d4a407..6748484cb9992a216cb759ad4cfed06713c5190a 100644 (file)
@@ -299,11 +299,11 @@ The general form of a *standard format specifier* is:
    precision: `integer`
    type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
 
-The *fill* character can be any character other than '}' (which signifies the
-end of the field).  The presence of a fill character is signaled by the *next*
-character, which must be one of the alignment options. If the second character
-of *format_spec* is not a valid alignment option, then it is assumed that both
-the fill character and the alignment option are absent.
+The *fill* character can be any character other than '{' or '}'.  The presence
+of a fill character is signaled by the character following it, which must be
+one of the alignment options.  If the second character of *format_spec* is not
+a valid alignment option, then it is assumed that both the fill character and
+the alignment option are absent.
 
 The meaning of the various alignment options is as follows:
 
index 3aaa6c6fa434cb4efd5346e6c7ce7578b7754594..0c441f8c4413bb22519265b80e3f9a590cca8ce2 100644 (file)
@@ -275,7 +275,7 @@ Exceptions
 Exceptions raised in the child process, before the new program has started to
 execute, will be re-raised in the parent.  Additionally, the exception object
 will have one extra attribute called :attr:`child_traceback`, which is a string
-containing traceback information from the childs point of view.
+containing traceback information from the child's point of view.
 
 The most common exception raised is :exc:`OSError`.  This occurs, for example,
 when trying to execute a non-existent file.  Applications should prepare for
index 68d0304fae9f046703f6d90a331cbd4bf8f680ab..2e36402006c091ebc12b1dfcce24b1cf9058627b 100644 (file)
@@ -33,6 +33,8 @@ This module defines the following functions and objects:
    variable allows one or more threads to wait until they are notified by another
    thread.
 
+   See :ref:`condition-objects`.
+
 
 .. function:: current_thread()
 
@@ -58,6 +60,8 @@ This module defines the following functions and objects:
    with the :meth:`clear` method.  The :meth:`wait` method blocks until the flag
    is true.
 
+   See :ref:`event-objects`.
+
 
 .. class:: local
 
@@ -80,6 +84,8 @@ This module defines the following functions and objects:
    acquired it, subsequent attempts to acquire it block, until it is released; any
    thread may release it.
 
+   See :ref:`lock-objects`.
+
 
 .. function:: RLock()
 
@@ -88,6 +94,8 @@ This module defines the following functions and objects:
    reentrant lock, the same thread may acquire it again without blocking; the
    thread must release it once for each time it has acquired it.
 
+   See :ref:`rlock-objects`.
+
 
 .. function:: Semaphore(value=1)
    :noindex:
@@ -98,6 +106,8 @@ This module defines the following functions and objects:
    if necessary until it can return without making the counter negative.  If not
    given, *value* defaults to 1.
 
+   See :ref:`semaphore-objects`.
+
 
 .. function:: BoundedSemaphore(value=1)
 
@@ -109,15 +119,21 @@ This module defines the following functions and objects:
 
 
 .. class:: Thread
+   :noindex:
 
    A class that represents a thread of control.  This class can be safely
    subclassed in a limited fashion.
 
+   See :ref:`thread-objects`.
+
 
 .. class:: Timer
+   :noindex:
 
    A thread that executes a function after a specified interval has passed.
 
+   See :ref:`timer-objects`.
+
 
 .. function:: settrace(func)
 
index e2db33cd2e424a24c06d6fbdfbc6a99e26e6c0e6..5582cf65317b3de6fa64df77b8e724b52ab1075d 100644 (file)
@@ -350,7 +350,8 @@ usage patterns to be encapsulated for convenient reuse.
 
 The execution of the :keyword:`with` statement with one "item" proceeds as follows:
 
-#. The context expression is evaluated to obtain a context manager.
+#. The context expression (the expression given in the :token:`with_item`) is
+   evaluated to obtain a context manager.
 
 #. The context manager's :meth:`__enter__` method is invoked.
 
index c71e89e694f8268b199ec5906a6d6b673b1d6033..f6a90cc20e131567113a56472556be5bc7bdeaaa 100644 (file)
@@ -1297,6 +1297,7 @@ groups from right to left).
 | ``+``, ``-``                                  | Addition and subtraction            |
 +-----------------------------------------------+-------------------------------------+
 | ``*``, ``/``, ``//``, ``%``                   | Multiplication, division, remainder |
+|                                               | [#]_                                |
 +-----------------------------------------------+-------------------------------------+
 | ``+x``, ``-x``, ``~x``                        | Positive, negative, bitwise NOT     |
 +-----------------------------------------------+-------------------------------------+
@@ -1339,5 +1340,7 @@ groups from right to left).
    the :keyword:`is` operator, like those involving comparisons between instance
    methods, or constants.  Check their documentation for more info.
 
+.. [#] The ``%`` is also used for string formatting; the same precedence applies.
+
 .. [#] The power operator ``**`` binds less tightly than an arithmetic or
    bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``.
index e364dcefecfaa438c56c3df2a3f15a1324f1cfbd..10a070c6ab36b93977d84886210c6c0623b7ecd6 100644 (file)
@@ -11,7 +11,7 @@
          <span class="linkdescr">keep this under your pillow</span></p>
       <p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">Language Reference</a><br/>
          <span class="linkdescr">describes syntax and language elements</span></p>
-      <p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Python Setup</a><br/>
+      <p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Python Setup and Usage</a><br/>
          <span class="linkdescr">how to use Python on different platforms</span></p>
       <p class="biglink"><a class="biglink" href="{{ pathto("howto/index") }}">Python HOWTOs</a><br/>
          <span class="linkdescr">in-depth documents on specific topics</span></p>
index 8394c1086bacc7b92bb47d76097e06ab0ded9741..4f3d49852aaaeb466dbb4dcd6b8e6f0aae73db7d 100644 (file)
@@ -371,7 +371,7 @@ with no duplicate elements.  Basic uses include membership testing and
 eliminating duplicate entries.  Set objects also support mathematical operations
 like union, intersection, difference, and symmetric difference.
 
-Curly braces or the :func:`set` function can be use to create sets. Note: To
+Curly braces or the :func:`set` function can be used to create sets.  Note: To
 create an empty set you have to use ``set()``, not ``{}``; the latter creates an
 empty dictionary, a data structure that we discuss in the next section.
 
index 6bba57854066c25745714065b9c416efce1b75e2..1201153daee61f12ceef689f6149ea06924e908e 100644 (file)
@@ -1,8 +1,8 @@
 .. _using-index:
 
-################
-  Python Setup
-################
+##########################
+  Python Setup and Usage
+##########################
 
 
 This part of the documentation is devoted to general information on the setup
index 3c2d4755dc5f5265b0c83732a73a9ff51c7a131e..21e514f222b5d54430c3617dc58ea6d7606be154 100644 (file)
@@ -36,7 +36,7 @@ AR=           @AR@
 RANLIB=                @RANLIB@
 SVNVERSION=    @SVNVERSION@
 
-GNULD=          @GNULD@
+GNULD=         @GNULD@
 
 # Shell used by make (some versions default to the login shell, which is bad)
 SHELL=         /bin/sh
index 84962b797dc0bf00c766ac0d997bcc9b6e3ac237..fa9a4712165e170cc81eb10fb3735c9b4a2cbfc4 100644 (file)
@@ -20,6 +20,25 @@ for details.  When the agreement is signed, please note it in this log.
 Permissions History
 -------------------
 
+- Lukasz Langa was given commit access on Sep 08 2010 by GFB,
+  at suggestion of Antoine Pitrou, for general bug fixing.
+
+- Daniel Stutzbach was given commit access on Aug 22 2010 by MvL,
+  for general bug fixing.
+
+- Ask Solem was given commit access on Aug 17 2010 by MvL,
+  on recommendation by Jesse Noller, for work on the multiprocessing
+  library.
+
+- George Boutsioukis was given commit access on Aug 10 2010
+  by MvL, for work on 2to3.
+
+- Éric Araujo was given commit access on Aug 10 2010 by BAC,
+  at suggestion of Tarek Ziadé.
+
+- Terry Reedy was given commit access on Aug 04 2010 by MvL,
+  at suggestion of Nick Coghlan.
+
 - Brian Quinlan was given commit access on Jul 26 2010 by GFB,
   for work related to PEP 3148.
 
index 6eb3a2ad7b53b75a2951a1a0fa763aeac429ccf0..bfc59855dd9834c201377463b708c5ff8fe18143 100644 (file)
@@ -82,10 +82,10 @@ PyDoc_STRVAR(fcntl_doc,
 Perform the requested operation on file descriptor fd.  The operation\n\
 is defined by op and is operating system dependent.  These constants are\n\
 available from the fcntl module.  The argument arg is optional, and\n\
-defaults to 0; it may be an int or a string. If arg is given as a string,\n\
+defaults to 0; it may be an int or a string.  If arg is given as a string,\n\
 the return value of fcntl is a string of that length, containing the\n\
-resulting value put in the arg buffer by the operating system.The length\n\
-of the arg string is not allowed to exceed 1024 bytes. If the arg given\n\
+resulting value put in the arg buffer by the operating system.  The length\n\
+of the arg string is not allowed to exceed 1024 bytes.  If the arg given\n\
 is an integer or if none is specified, the result value is an integer\n\
 corresponding to the return value of the fcntl call in the C code.");