]> granicus.if.org Git - python/commitdiff
Merged revisions 68116-68119,68121,68123-68127 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Thu, 1 Jan 2009 15:05:06 +0000 (15:05 +0000)
committerBenjamin Peterson <benjamin@python.org>
Thu, 1 Jan 2009 15:05:06 +0000 (15:05 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68116 | georg.brandl | 2009-01-01 05:46:51 -0600 (Thu, 01 Jan 2009) | 2 lines

  #4100: note that element children are not necessarily present on "start" events.
........
  r68117 | georg.brandl | 2009-01-01 05:53:55 -0600 (Thu, 01 Jan 2009) | 2 lines

  #4156: make clear that "protocol" is to be replaced with the protocol name.
........
  r68118 | georg.brandl | 2009-01-01 06:00:19 -0600 (Thu, 01 Jan 2009) | 2 lines

  #4185: clarify escape behavior of replacement strings.
........
  r68119 | georg.brandl | 2009-01-01 06:09:40 -0600 (Thu, 01 Jan 2009) | 3 lines

  #4222: document dis.findlabels() and dis.findlinestarts() and
  put them into dis.__all__.
........
  r68121 | georg.brandl | 2009-01-01 06:43:33 -0600 (Thu, 01 Jan 2009) | 2 lines

  Point to types module in new module deprecation notice.
........
  r68123 | georg.brandl | 2009-01-01 06:52:29 -0600 (Thu, 01 Jan 2009) | 2 lines

  #4784: ... on three counts ...
........
  r68124 | georg.brandl | 2009-01-01 06:53:19 -0600 (Thu, 01 Jan 2009) | 2 lines

  #4782: Fix markup error that hid load() and loads().
........
  r68125 | georg.brandl | 2009-01-01 07:02:09 -0600 (Thu, 01 Jan 2009) | 2 lines

  #4776: add data_files and package_dir arguments.
........
  r68126 | georg.brandl | 2009-01-01 07:05:13 -0600 (Thu, 01 Jan 2009) | 2 lines

  Handlers are in the `logging.handlers` module.
........
  r68127 | georg.brandl | 2009-01-01 07:14:49 -0600 (Thu, 01 Jan 2009) | 2 lines

  #4767: Use correct submodules for all MIME classes.
........

Doc/distutils/apiref.rst
Doc/library/dis.rst
Doc/library/email.mime.rst
Doc/library/json.rst
Doc/library/logging.rst
Doc/library/webbrowser.rst
Doc/library/xml.etree.elementtree.rst
Lib/dis.py
Lib/re.py

index c3148a647ccd289b554e0ded4c91df0f95283e09..aec68c083edbfba05d57297aff3b29b534cefa72 100644 (file)
@@ -88,9 +88,9 @@ setup script). Indirectly provides the  :class:`distutils.dist.Distribution` and
    | *options*          | default options for the setup  | a string                                                    |
    |                    | script                         |                                                             |
    +--------------------+--------------------------------+-------------------------------------------------------------+
-   | *license*          | The license for the package    |                                                             |
+   | *license*          | The license for the package    | a string                                                    |
    +--------------------+--------------------------------+-------------------------------------------------------------+
-   | *keywords*         | Descriptive meta-data. See     |                                                             |
+   | *keywords*         | Descriptive meta-data, see     |                                                             |
    |                    | :pep:`314`                     |                                                             |
    +--------------------+--------------------------------+-------------------------------------------------------------+
    | *platforms*        |                                |                                                             |
@@ -98,6 +98,13 @@ setup script). Indirectly provides the  :class:`distutils.dist.Distribution` and
    | *cmdclass*         | A mapping of command names to  | a dictionary                                                |
    |                    | :class:`Command` subclasses    |                                                             |
    +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *data_files*       | A list of data files to        | a list                                                      |
+   |                    | install                        |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   | *package_dir*      | A mapping of package to        | a dictionary                                                |
+   |                    | directory names                |                                                             |
+   +--------------------+--------------------------------+-------------------------------------------------------------+
+   
 
 
 .. function:: run_setup(script_name[, script_args=None, stop_after='run'])
index ab06542b88d9eff2788bffc58ecf7efa535f2949..39d37dfca7eac39e2ce29926178d2a799b653c8b 100644 (file)
@@ -64,10 +64,23 @@ The :mod:`dis` module defines the following functions and constants:
 
 .. function:: disco(code[, lasti])
 
-   A synonym for disassemble.  It is more convenient to type, and kept for
-   compatibility with earlier Python releases.
+   A synonym for :func:`disassemble`.  It is more convenient to type, and kept
+   for compatibility with earlier Python releases.
 
 
+.. function:: findlinestarts(code)
+
+   This generator function uses the ``co_firstlineno`` and ``co_lnotab``
+   attributes of the code object *code* to find the offsets which are starts of
+   lines in the source code.  They are generated as ``(offset, lineno)`` pairs.
+
+
+.. function:: findlabels(code)
+
+   Detect all offsets in the code object *code* which are jump targets, and
+   return a list of these offsets.
+   
+   
 .. data:: opname
 
    Sequence of operation names, indexable using the bytecode.
index 13bd100ddf33afbba22c660902aaf34b86f3378a..b0d2adc7224796a127b2cfafb5276b41f3a8ef1e 100644 (file)
@@ -19,6 +19,7 @@ things easier.
 
 Here are the classes:
 
+.. currentmodule:: email.mime.base
 
 .. class:: MIMEBase(_maintype, _subtype, **_params)
 
@@ -39,6 +40,8 @@ Here are the classes:
    :mailheader:`MIME-Version` header (always set to ``1.0``).
 
 
+.. currentmodule:: email.mime.nonmultipart
+
 .. class:: MIMENonMultipart()
 
    Module: :mod:`email.mime.nonmultipart`
@@ -50,6 +53,8 @@ Here are the classes:
    :exc:`MultipartConversionError` exception is raised.
 
 
+.. currentmodule:: email.mime.multipart
+
 .. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]])
 
    Module: :mod:`email.mime.multipart`
@@ -73,6 +78,8 @@ Here are the classes:
    dictionary.
 
 
+.. currentmodule:: email.mime.application
+
 .. class:: MIMEApplication(_data[, _subtype[, _encoder[, **_params]]])
 
    Module: :mod:`email.mime.application`
@@ -93,6 +100,8 @@ Here are the classes:
    *_params* are passed straight through to the base class constructor.
 
 
+.. currentmodule:: email.mime.audio
+
 .. class:: MIMEAudio(_audiodata[, _subtype[, _encoder[, **_params]]])
 
    Module: :mod:`email.mime.audio`
@@ -116,6 +125,8 @@ Here are the classes:
    *_params* are passed straight through to the base class constructor.
 
 
+.. currentmodule:: email.mime.image
+
 .. class:: MIMEImage(_imagedata[, _subtype[, _encoder[, **_params]]])
 
    Module: :mod:`email.mime.image`
@@ -139,6 +150,8 @@ Here are the classes:
    *_params* are passed straight through to the :class:`MIMEBase` constructor.
 
 
+.. currentmodule:: email.mime.message
+
 .. class:: MIMEMessage(_msg[, _subtype])
 
    Module: :mod:`email.mime.message`
@@ -152,6 +165,8 @@ Here are the classes:
    :mimetype:`rfc822`.
 
 
+.. currentmodule:: email.mime.text
+
 .. class:: MIMEText(_text[, _subtype[, _charset]])
 
    Module: :mod:`email.mime.text`
index b67d724e13f06a56846f3b3488f77ebd14f7b368..cad841e849025600c88d52d8cdbcfa90a4085c1a 100644 (file)
@@ -165,7 +165,7 @@ Basic Usage
    :func:`dump`.
 
 
-.. function load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]])
+.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]])
 
    Deserialize *fp* (a ``.read()``-supporting file-like object containing a JSON
    document) to a Python object.
@@ -201,7 +201,7 @@ Basic Usage
    class.
 
 
-.. function loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]])
+.. function:: loads(s[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, **kw]]]]]]])
 
    Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON
    document) to a Python object.
index d1e4f7662d9d4770db297940445c168974f4da65..df857b1b78dcfc9e5fccf6bfb17876aaee722330 100644 (file)
@@ -1534,6 +1534,8 @@ subclasses. However, the :meth:`__init__` method in subclasses needs to call
 StreamHandler
 ^^^^^^^^^^^^^
 
+.. module:: logging.handlers
+
 The :class:`StreamHandler` class, located in the core :mod:`logging` package,
 sends logging output to streams such as *sys.stdout*, *sys.stderr* or any
 file-like object (or, more precisely, any object which supports :meth:`write`
@@ -2035,6 +2037,8 @@ supports sending logging messages to a Web server, using either ``GET`` or
 Formatter Objects
 -----------------
 
+.. currentmodule:: logging
+
 :class:`Formatter`\ s have the following attributes and methods. They are
 responsible for converting a :class:`LogRecord` to (usually) a string which can
 be interpreted by either a human or an external system. The base
index 95e21b1e4809b41ad9146aa6bfb4f43fa78528a9..410fa48022df596404335938f781b3bb54a90b5b 100644 (file)
@@ -167,7 +167,7 @@ Here are some simple examples::
 Browser Controller Objects
 --------------------------
 
-Browser controllers provide two methods which parallel two of the module-level
+Browser controllers provide these methods which parallel two of the module-level
 convenience functions:
 
 
index fde4fa68d679d16676d3ba71772b07ad15ed6fae..d411c24b3bf4d087da46d8801d045e01582c479d 100644 (file)
@@ -94,6 +94,16 @@ Functions
    *events* is a list of events to report back.  If omitted, only "end" events are
    reported. Returns an :term:`iterator` providing ``(event, elem)`` pairs.
 
+   .. note::
+
+      :func:`iterparse` only guarantees that it has seen the ">"
+      character of a starting tag when it emits a "start" event, so the
+      attributes are defined, but the contents of the text and tail attributes
+      are undefined at that point.  The same applies to the element children;
+      they may or may not be present.
+
+      If you need a fully populated element, look for "end" events instead.
+
 
 .. function:: parse(source[, parser])
 
index c98f0c0a8daf6fc6b82f95291c4ec9a1f8c1ca33..2b400dc88f9e784c3785982955b65c845dd0687f 100644 (file)
@@ -6,7 +6,8 @@ import types
 from opcode import *
 from opcode import __all__ as _opcodes_all
 
-__all__ = ["dis","disassemble","distb","disco"] + _opcodes_all
+__all__ = ["dis", "disassemble", "distb", "disco",
+           "findlinestarts", "findlabels"] + _opcodes_all
 del _opcodes_all
 
 def dis(x=None):
index 090ec8a07b44a13410978572dff4b380d1132383..d2fc25da372383bb993fd0a6154d28df09535ef0 100644 (file)
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -160,7 +160,8 @@ def sub(pattern, repl, string, count=0):
     """Return the string obtained by replacing the leftmost
     non-overlapping occurrences of the pattern in string by the
     replacement repl.  repl can be either a string or a callable;
-    if a callable, it's passed the match object and must return
+    if a string, backslash escapes in it are processed.  If it is
+    a callable, it's passed the match object and must return
     a replacement string to be used."""
     return _compile(pattern, 0).sub(repl, string, count)
 
@@ -170,7 +171,8 @@ def subn(pattern, repl, string, count=0):
     non-overlapping occurrences of the pattern in the source
     string by the replacement repl.  number is the number of
     substitutions that were made. repl can be either a string or a
-    callable; if a callable, it's passed the match object and must
+    callable; if a string, backslash escapes in it are processed.
+    If it is a callable, it's passed the match object and must
     return a replacement string to be used."""
     return _compile(pattern, 0).subn(repl, string, count)