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/whatsnew
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Doc/whatsnew/2.0.rst

    r2 r388  
    657657arguments accepted by some methods.  Some methods would take multiple arguments
    658658and treat them as a tuple, particularly various list methods such as
    659 :meth:`.append` and :meth:`.insert`. In earlier versions of Python, if ``L`` is
     659:meth:`append` and :meth:`insert`. In earlier versions of Python, if ``L`` is
    660660a list, ``L.append( 1,2 )`` appends the tuple ``(1,2)`` to the list.  In Python
    6616612.0 this causes a :exc:`TypeError` exception to be raised, with the message:
  • python/vendor/current/Doc/whatsnew/2.1.rst

    r2 r388  
    732732
    733733  For a fuller discussion of the line I/O changes, see the python-dev summary for
    734   January 1-15, 2001 at http://www.python.org/dev/summary/2001-01-1.html.
     734  January 1-15, 2001 at http://www.python.org/dev/summary/2001-01-1/.
    735735
    736736* A new method, :meth:`popitem`, was added to dictionaries to enable
  • python/vendor/current/Doc/whatsnew/2.2.rst

    r2 r388  
    3131
    3232
    33 .. seealso (now defunct)
     33.. see also, now defunct
    3434
    3535   http://www.unixreview.com/documents/s=1356/urm0109h/0109h.htm
     
    451451return a new iterator for the object; if the object is its own iterator, this
    452452method can just return ``self``.  In particular, iterators will usually be their
    453 own iterators.  Extension types implemented in C can implement a :attr:`tp_iter`
     453own iterators.  Extension types implemented in C can implement a :c:member:`~PyTypeObject.tp_iter`
    454454function in order to return an iterator, and extension types that want to behave
    455 as iterators can define a :attr:`tp_iternext` function.
     455as iterators can define a :c:member:`~PyTypeObject.tp_iternext` function.
    456456
    457457So, after all this, what do iterators actually do?  They have one required
     
    479479expects something for which :func:`iter` will return an iterator. For backward
    480480compatibility and convenience, an iterator is automatically constructed for
    481 sequences that don't implement :meth:`__iter__` or a :attr:`tp_iter` slot, so
     481sequences that don't implement :meth:`__iter__` or a :c:member:`~PyTypeObject.tp_iter` slot, so
    482482``for i in [1,2,3]`` will still work.  Wherever the Python interpreter loops
    483483over a sequence, it's been changed to use the iterator protocol.  This means you
     
    755755* Classes can define methods called :meth:`__truediv__` and :meth:`__floordiv__`
    756756  to overload the two division operators.  At the C level, there are also slots in
    757   the :ctype:`PyNumberMethods` structure so extension types can define the two
     757  the :c:type:`PyNumberMethods` structure so extension types can define the two
    758758  operators.
    759759
     
    984984
    985985* Two new format characters were added to the :mod:`struct` module for 64-bit
    986   integers on platforms that support the C :ctype:`long long` type.  ``q`` is for
     986  integers on platforms that support the C :c:type:`long long` type.  ``q`` is for
    987987  a signed 64-bit integer, and ``Q`` is for an unsigned one.  The value is
    988988  returned in Python's long integer type.  (Contributed by Tim Peters.)
     
    10581058  of profiling and tracing.  This  will be of interest to authors of development
    10591059  environments for Python.  Two new C functions were added to Python's API,
    1060   :cfunc:`PyEval_SetProfile` and :cfunc:`PyEval_SetTrace`. The existing
     1060  :c:func:`PyEval_SetProfile` and :c:func:`PyEval_SetTrace`. The existing
    10611061  :func:`sys.setprofile` and :func:`sys.settrace` functions still exist, and have
    10621062  simply been changed to use the new C-level interface.  (Contributed by Fred L.
     
    10641064
    10651065* Another low-level API, primarily of interest to implementors of Python
    1066   debuggers and development tools, was added. :cfunc:`PyInterpreterState_Head` and
    1067   :cfunc:`PyInterpreterState_Next` let a caller walk through all the existing
    1068   interpreter objects; :cfunc:`PyInterpreterState_ThreadHead` and
    1069   :cfunc:`PyThreadState_Next` allow looping over all the thread states for a given
     1066  debuggers and development tools, was added. :c:func:`PyInterpreterState_Head` and
     1067  :c:func:`PyInterpreterState_Next` let a caller walk through all the existing
     1068  interpreter objects; :c:func:`PyInterpreterState_ThreadHead` and
     1069  :c:func:`PyThreadState_Next` allow looping over all the thread states for a given
    10701070  interpreter.  (Contributed by David Beazley.)
    10711071
     
    10791079  To upgrade an extension module to the new API, perform the following steps:
    10801080
    1081 * Rename :cfunc:`Py_TPFLAGS_GC` to :cfunc:`PyTPFLAGS_HAVE_GC`.
    1082 
    1083 * Use :cfunc:`PyObject_GC_New` or :cfunc:`PyObject_GC_NewVar` to allocate
    1084     objects, and :cfunc:`PyObject_GC_Del` to deallocate them.
    1085 
    1086 * Rename :cfunc:`PyObject_GC_Init` to :cfunc:`PyObject_GC_Track` and
    1087     :cfunc:`PyObject_GC_Fini` to :cfunc:`PyObject_GC_UnTrack`.
    1088 
    1089 * Remove :cfunc:`PyGC_HEAD_SIZE` from object size calculations.
    1090 
    1091 * Remove calls to :cfunc:`PyObject_AS_GC` and :cfunc:`PyObject_FROM_GC`.
    1092 
    1093 * A new ``et`` format sequence was added to :cfunc:`PyArg_ParseTuple`; ``et``
     1081* Rename :c:func:`Py_TPFLAGS_GC` to :c:func:`PyTPFLAGS_HAVE_GC`.
     1082
     1083* Use :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar` to allocate
     1084    objects, and :c:func:`PyObject_GC_Del` to deallocate them.
     1085
     1086* Rename :c:func:`PyObject_GC_Init` to :c:func:`PyObject_GC_Track` and
     1087    :c:func:`PyObject_GC_Fini` to :c:func:`PyObject_GC_UnTrack`.
     1088
     1089* Remove :c:func:`PyGC_HEAD_SIZE` from object size calculations.
     1090
     1091* Remove calls to :c:func:`PyObject_AS_GC` and :c:func:`PyObject_FROM_GC`.
     1092
     1093* A new ``et`` format sequence was added to :c:func:`PyArg_ParseTuple`; ``et``
    10941094  takes both a parameter and an encoding name, and converts the parameter to the
    10951095  given encoding if the parameter turns out to be a Unicode string, or leaves it
     
    11001100  support on Windows described in the following section.)
    11011101
    1102 * A different argument parsing function, :cfunc:`PyArg_UnpackTuple`, has been
     1102* A different argument parsing function, :c:func:`PyArg_UnpackTuple`, has been
    11031103  added that's simpler and presumably faster.  Instead of specifying a format
    11041104  string, the caller simply gives the minimum and maximum number of arguments
    1105   expected, and a set of pointers to :ctype:`PyObject\*` variables that will be
     1105  expected, and a set of pointers to :c:type:`PyObject\*` variables that will be
    11061106  filled in with argument values.
    11071107
     
    11121112  :const:`METH_OLDARGS` style of writing C methods is  now officially deprecated.
    11131113
    1114 * Two new wrapper functions, :cfunc:`PyOS_snprintf` and :cfunc:`PyOS_vsnprintf`
     1114* Two new wrapper functions, :c:func:`PyOS_snprintf` and :c:func:`PyOS_vsnprintf`
    11151115  were added to provide  cross-platform implementations for the relatively new
    1116   :cfunc:`snprintf` and :cfunc:`vsnprintf` C lib APIs. In contrast to the standard
    1117   :cfunc:`sprintf` and :cfunc:`vsprintf` functions, the Python versions check the
     1116  :c:func:`snprintf` and :c:func:`vsnprintf` C lib APIs. In contrast to the standard
     1117  :c:func:`sprintf` and :c:func:`vsprintf` functions, the Python versions check the
    11181118  bounds of the buffer used to protect against buffer overruns. (Contributed by
    11191119  M.-A. Lemburg.)
    11201120
    1121 * The :cfunc:`_PyTuple_Resize` function has lost an unused parameter, so now it
     1121* The :c:func:`_PyTuple_Resize` function has lost an unused parameter, so now it
    11221122  takes 2 parameters instead of 3.  The third argument was never used, and can
    11231123  simply be discarded when porting code from earlier versions to Python 2.2.
     
    12201220  :meth:`tolist` method and the :attr:`start`, :attr:`stop`, and :attr:`step`
    12211221  attributes are also being deprecated.  At the C level, the fourth argument to
    1222   the :cfunc:`PyRange_New` function, ``repeat``, has also been deprecated.
     1222  the :c:func:`PyRange_New` function, ``repeat``, has also been deprecated.
    12231223
    12241224* There were a bunch of patches to the dictionary implementation, mostly to fix
     
    12431243  in case they're also usable as modules.  (Implemented by David Bolen.)
    12441244
    1245 * On platforms where Python uses the C :cfunc:`dlopen` function  to load
    1246   extension modules, it's now possible to set the flags used  by :cfunc:`dlopen`
     1245* On platforms where Python uses the C :c:func:`dlopen` function  to load
     1246  extension modules, it's now possible to set the flags used  by :c:func:`dlopen`
    12471247  using the :func:`sys.getdlopenflags` and :func:`sys.setdlopenflags` functions.
    12481248  (Contributed by Bram Stolk.)
  • python/vendor/current/Doc/whatsnew/2.3.rst

    r2 r388  
    367367
    368368
     369.. index::
     370   single: universal newlines; What's new
     371
    369372PEP 278: Universal Newline Support
    370373==================================
     
    377380two-character sequence of a carriage return plus a newline.
    378381
    379 Python's file objects can now support end of line conventions other than the one
    380 followed by the platform on which Python is running. Opening a file with the
    381 mode ``'U'`` or ``'rU'`` will open a file for reading in universal newline mode.
    382 All three line ending conventions will be translated to a ``'\n'`` in the
    383 strings returned by the various file methods such as :meth:`read` and
    384 :meth:`readline`.
     382Python's file objects can now support end of line conventions other than the
     383one followed by the platform on which Python is running. Opening a file with
     384the mode ``'U'`` or ``'rU'`` will open a file for reading in :term:`universal
     385newlines` mode.  All three line ending conventions will be translated to a
     386``'\n'`` in the strings returned by the various file methods such as
     387:meth:`read` and :meth:`readline`.
    385388
    386389Universal newline support is also used when importing modules and when executing
     
    17991802Pymalloc, a specialized object allocator written by Vladimir Marangozov, was a
    18001803feature added to Python 2.1.  Pymalloc is intended to be faster than the system
    1801 :cfunc:`malloc` and to have less memory overhead for allocation patterns typical
    1802 of Python programs. The allocator uses C's :cfunc:`malloc` function to get large
     1804:c:func:`malloc` and to have less memory overhead for allocation patterns typical
     1805of Python programs. The allocator uses C's :c:func:`malloc` function to get large
    18031806pools of memory and then fulfills smaller memory requests from these pools.
    18041807
     
    18161819There's one particularly common error that causes problems.  There are a number
    18171820of memory allocation functions in Python's C API that have previously just been
    1818 aliases for the C library's :cfunc:`malloc` and :cfunc:`free`, meaning that if
     1821aliases for the C library's :c:func:`malloc` and :c:func:`free`, meaning that if
    18191822you accidentally called mismatched functions the error wouldn't be noticeable.
    18201823When the object allocator is enabled, these functions aren't aliases of
    1821 :cfunc:`malloc` and :cfunc:`free` any more, and calling the wrong function to
     1824:c:func:`malloc` and :c:func:`free` any more, and calling the wrong function to
    18221825free memory may get you a core dump.  For example, if memory was allocated using
    1823 :cfunc:`PyObject_Malloc`, it has to be freed using :cfunc:`PyObject_Free`, not
    1824 :cfunc:`free`.  A few modules included with Python fell afoul of this and had to
     1826:c:func:`PyObject_Malloc`, it has to be freed using :c:func:`PyObject_Free`, not
     1827:c:func:`free`.  A few modules included with Python fell afoul of this and had to
    18251828be fixed; doubtless there are more third-party modules that will have the same
    18261829problem.
     
    18331836
    18341837* To allocate and free an undistinguished chunk of memory use the "raw memory"
    1835   family: :cfunc:`PyMem_Malloc`, :cfunc:`PyMem_Realloc`, and :cfunc:`PyMem_Free`.
     1838  family: :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc`, and :c:func:`PyMem_Free`.
    18361839
    18371840* The "object memory" family is the interface to the pymalloc facility described
    18381841  above and is biased towards a large number of "small" allocations:
    1839   :cfunc:`PyObject_Malloc`, :cfunc:`PyObject_Realloc`, and :cfunc:`PyObject_Free`.
     1842  :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc`, and :c:func:`PyObject_Free`.
    18401843
    18411844* To allocate and free Python objects, use the "object" family
    1842   :cfunc:`PyObject_New`, :cfunc:`PyObject_NewVar`, and :cfunc:`PyObject_Del`.
     1845  :c:func:`PyObject_New`, :c:func:`PyObject_NewVar`, and :c:func:`PyObject_Del`.
    18431846
    18441847Thanks to lots of work by Tim Peters, pymalloc in 2.3 also provides debugging
     
    18791882  Python's :program:`configure` script.  (Contributed by Ondrej Palkovsky.)
    18801883
    1881 * The :cmacro:`DL_EXPORT` and :cmacro:`DL_IMPORT` macros are now deprecated.
     1884* The :c:macro:`DL_EXPORT` and :c:macro:`DL_IMPORT` macros are now deprecated.
    18821885  Initialization functions for Python extension modules should now be declared
    1883   using the new macro :cmacro:`PyMODINIT_FUNC`, while the Python core will
    1884   generally use the :cmacro:`PyAPI_FUNC` and :cmacro:`PyAPI_DATA` macros.
     1886  using the new macro :c:macro:`PyMODINIT_FUNC`, while the Python core will
     1887  generally use the :c:macro:`PyAPI_FUNC` and :c:macro:`PyAPI_DATA` macros.
    18851888
    18861889* The interpreter can be compiled without any docstrings for the built-in
     
    18901893  by Gustavo Niemeyer.)
    18911894
    1892 * The :cfunc:`PyArg_NoArgs` macro is now deprecated, and code that uses it
     1895* The :c:func:`PyArg_NoArgs` macro is now deprecated, and code that uses it
    18931896  should be changed.  For Python 2.2 and later, the method definition table can
    18941897  specify the :const:`METH_NOARGS` flag, signalling that there are no arguments,
     
    18971900  "")`` instead, but this will be slower than using :const:`METH_NOARGS`.
    18981901
    1899 * :cfunc:`PyArg_ParseTuple` accepts new format characters for various sizes of
    1900   unsigned integers: ``B`` for :ctype:`unsigned char`, ``H`` for :ctype:`unsigned
    1901   short int`,  ``I`` for :ctype:`unsigned int`,  and ``K`` for :ctype:`unsigned
     1902* :c:func:`PyArg_ParseTuple` accepts new format characters for various sizes of
     1903  unsigned integers: ``B`` for :c:type:`unsigned char`, ``H`` for :c:type:`unsigned
     1904  short int`,  ``I`` for :c:type:`unsigned int`,  and ``K`` for :c:type:`unsigned
    19021905  long long`.
    19031906
    1904 * A new function, :cfunc:`PyObject_DelItemString(mapping, char \*key)` was added
     1907* A new function, :c:func:`PyObject_DelItemString(mapping, char \*key)` was added
    19051908  as shorthand for ``PyObject_DelItem(mapping, PyString_New(key))``.
    19061909
     
    19121915* It's now possible to define class and static methods for a C extension type by
    19131916  setting either the :const:`METH_CLASS` or :const:`METH_STATIC` flags in a
    1914   method's :ctype:`PyMethodDef` structure.
     1917  method's :c:type:`PyMethodDef` structure.
    19151918
    19161919* Python now includes a copy of the Expat XML parser's source code, removing any
  • python/vendor/current/Doc/whatsnew/2.4.rst

    r2 r388  
    412412subprocess and the parent.
    413413
     414.. index::
     415   single: universal newlines; What's new
     416
    414417The constructor has a number of handy options:
    415418
     
    425428
    426429* *universal_newlines* opens the child's input and output using Python's
    427   universal newline feature.
     430  :term:`universal newlines` feature.
    428431
    429432Once you've created the :class:`Popen` instance,  you can call its :meth:`wait`
     
    471474
    472475Python has always supported floating-point (FP) numbers, based on the underlying
    473 C :ctype:`double` type, as a data type.  However, while most programming
     476C :c:type:`double` type, as a data type.  However, while most programming
    474477languages provide a floating-point type, many people (even programmers) are
    475478unaware that floating-point numbers don't represent certain decimal fractions
     
    500503
    501504Modern systems usually provide floating-point support that conforms to a
    502 standard called IEEE 754.  C's :ctype:`double` type is usually implemented as a
     505standard called IEEE 754.  C's :c:type:`double` type is usually implemented as a
    50350664-bit IEEE 754 number, which uses 52 bits of space for the mantissa.  This
    504507means that numbers can only be specified to 52 bits of precision.  If you're
     
    738741functions in Python's implementation required that the numeric locale remain set
    739742to the ``'C'`` locale.  Often this was because the code was using the C
    740 library's :cfunc:`atof` function.
     743library's :c:func:`atof` function.
    741744
    742745Not setting the numeric locale caused trouble for extensions that used third-
     
    748751API that perform ASCII-only conversions, ignoring the locale setting:
    749752
    750 * :cfunc:`PyOS_ascii_strtod(str, ptr)`  and :cfunc:`PyOS_ascii_atof(str, ptr)`
    751   both convert a string to a C :ctype:`double`.
    752 
    753 * :cfunc:`PyOS_ascii_formatd(buffer, buf_len, format, d)` converts a
    754   :ctype:`double` to an ASCII string.
     753* :c:func:`PyOS_ascii_strtod(str, ptr)`  and :c:func:`PyOS_ascii_atof(str, ptr)`
     754  both convert a string to a C :c:type:`double`.
     755
     756* :c:func:`PyOS_ascii_formatd(buffer, buf_len, format, d)` converts a
     757  :c:type:`double` to an ASCII string.
    755758
    756759The code for these functions came from the GLib library
     
    940943  space efficiency.  Appending and popping from lists now runs faster due to more
    941944  efficient code paths and less frequent use of the underlying system
    942   :cfunc:`realloc`.  List comprehensions also benefit.   :meth:`list.extend` was
     945  :c:func:`realloc`.  List comprehensions also benefit.   :meth:`list.extend` was
    943946  also optimized and no longer converts its argument into a temporary list before
    944947  extending the base list.  (Contributed by Raymond Hettinger.)
     
    949952
    950953* The methods :meth:`list.__getitem__`, :meth:`dict.__getitem__`, and
    951   :meth:`dict.__contains__` are are now implemented as :class:`method_descriptor`
     954  :meth:`dict.__contains__` are now implemented as :class:`method_descriptor`
    952955  objects rather than :class:`wrapper_descriptor` objects.  This form of  access
    953956  doubles their performance and makes them more suitable for use as arguments to
     
    10681071  3.0 version of the package uses a new incremental parser for MIME messages,
    10691072  available in the :mod:`email.FeedParser` module.  The new parser doesn't require
    1070   reading the entire message into memory, and doesn't throw exceptions if a
     1073  reading the entire message into memory, and doesn't raise exceptions if a
    10711074  message is malformed; instead it records any problems in the  :attr:`defect`
    10721075  attribute of the message.  (Developed by Anthony Baxter, Barry Warsaw, Thomas
     
    14471450
    14481451* Three new convenience macros were added for common return values from
    1449   extension functions: :cmacro:`Py_RETURN_NONE`, :cmacro:`Py_RETURN_TRUE`, and
    1450   :cmacro:`Py_RETURN_FALSE`. (Contributed by Brett Cannon.)
    1451 
    1452 * Another new macro, :cmacro:`Py_CLEAR(obj)`,  decreases the reference count of
     1452  extension functions: :c:macro:`Py_RETURN_NONE`, :c:macro:`Py_RETURN_TRUE`, and
     1453  :c:macro:`Py_RETURN_FALSE`. (Contributed by Brett Cannon.)
     1454
     1455* Another new macro, :c:macro:`Py_CLEAR(obj)`,  decreases the reference count of
    14531456  *obj* and sets *obj* to the null pointer.  (Contributed by Jim Fulton.)
    14541457
    1455 * A new function, :cfunc:`PyTuple_Pack(N, obj1, obj2, ..., objN)`, constructs
     1458* A new function, :c:func:`PyTuple_Pack(N, obj1, obj2, ..., objN)`, constructs
    14561459  tuples from a variable length argument list of Python objects.  (Contributed by
    14571460  Raymond Hettinger.)
    14581461
    1459 * A new function, :cfunc:`PyDict_Contains(d, k)`, implements fast dictionary
     1462* A new function, :c:func:`PyDict_Contains(d, k)`, implements fast dictionary
    14601463  lookups without masking exceptions raised during the look-up process.
    14611464  (Contributed by Raymond Hettinger.)
    14621465
    1463 * The :cmacro:`Py_IS_NAN(X)` macro returns 1 if  its float or double argument
     1466* The :c:macro:`Py_IS_NAN(X)` macro returns 1 if  its float or double argument
    14641467  *X* is a NaN.   (Contributed by Tim Peters.)
    14651468
    14661469* C code can avoid unnecessary locking by using the new
    1467   :cfunc:`PyEval_ThreadsInitialized` function to tell  if any thread operations
     1470  :c:func:`PyEval_ThreadsInitialized` function to tell  if any thread operations
    14681471  have been performed.  If this function  returns false, no lock operations are
    14691472  needed. (Contributed by Nick Coghlan.)
    14701473
    1471 * A new function, :cfunc:`PyArg_VaParseTupleAndKeywords`, is the same as
    1472   :cfunc:`PyArg_ParseTupleAndKeywords` but takes a  :ctype:`va_list` instead of a
     1474* A new function, :c:func:`PyArg_VaParseTupleAndKeywords`, is the same as
     1475  :c:func:`PyArg_ParseTupleAndKeywords` but takes a  :c:type:`va_list` instead of a
    14731476  number of arguments. (Contributed by Greg Chapman.)
    14741477
    14751478* A new method flag, :const:`METH_COEXISTS`, allows a function defined in slots
    1476   to co-exist with a :ctype:`PyCFunction` having the same name.  This can halve
     1479  to co-exist with a :c:type:`PyCFunction` having the same name.  This can halve
    14771480  the access time for a method such as :meth:`set.__contains__`.  (Contributed by
    14781481  Raymond Hettinger.)
     
    14881491  register".  (Contributed by Jeremy Hylton.)
    14891492
    1490 * The :ctype:`tracebackobject` type has been renamed to
    1491   :ctype:`PyTracebackObject`.
     1493* The :c:type:`tracebackobject` type has been renamed to
     1494  :c:type:`PyTracebackObject`.
    14921495
    14931496.. ======================================================================
     
    15561559
    15571560The author would like to thank the following people for offering suggestions,
    1558 corrections and assistance with various drafts of this article: Koray Can, Hye-
    1559 Shik Chang, Michael Dyck, Raymond Hettinger, Brian Hurt, Hamish Lawson, Fredrik
    1560 Lundh, Sean Reifschneider, Sadruddin Rejeb.
    1561 
     1561corrections and assistance with various drafts of this article: Koray Can,
     1562Hye-Shik Chang, Michael Dyck, Raymond Hettinger, Brian Hurt, Hamish Lawson,
     1563Fredrik Lundh, Sean Reifschneider, Sadruddin Rejeb.
     1564
  • python/vendor/current/Doc/whatsnew/2.5.rst

    r2 r388  
    871871========================================
    872872
    873 A wide-ranging change to Python's C API, using a new  :ctype:`Py_ssize_t` type
    874 definition instead of :ctype:`int`,  will permit the interpreter to handle more
     873A wide-ranging change to Python's C API, using a new  :c:type:`Py_ssize_t` type
     874definition instead of :c:type:`int`,  will permit the interpreter to handle more
    875875data on 64-bit platforms. This change doesn't affect Python's capacity on 32-bit
    876876platforms.
    877877
    878 Various pieces of the Python interpreter used C's :ctype:`int` type to store
     878Various pieces of the Python interpreter used C's :c:type:`int` type to store
    879879sizes or counts; for example, the number of items in a list or tuple were stored
    880 in an :ctype:`int`.  The C compilers for most 64-bit platforms still define
    881 :ctype:`int` as a 32-bit type, so that meant that lists could only hold up to
     880in an :c:type:`int`.  The C compilers for most 64-bit platforms still define
     881:c:type:`int` as a 32-bit type, so that meant that lists could only hold up to
    882882``2**31 - 1`` = 2147483647 items. (There are actually a few different
    883883programming models that 64-bit C compilers can use -- see
    884884http://www.unix.org/version2/whatsnew/lp64_wp.html for a discussion -- but the
    885 most commonly available model leaves :ctype:`int` as 32 bits.)
     885most commonly available model leaves :c:type:`int` as 32 bits.)
    886886
    887887A limit of 2147483647 items doesn't really matter on a 32-bit platform because
    888888you'll run out of memory before hitting the length limit. Each list item
    889889requires space for a pointer, which is 4 bytes, plus space for a
    890 :ctype:`PyObject` representing the item.  2147483647\*4 is already more bytes
     890:c:type:`PyObject` representing the item.  2147483647\*4 is already more bytes
    891891than a 32-bit address space can contain.
    892892
     
    895895unreasonable that Python programmers might construct lists that large.
    896896Therefore, the Python interpreter had to be changed to use some type other than
    897 :ctype:`int`, and this will be a 64-bit type on 64-bit platforms.  The change
     897:c:type:`int`, and this will be a 64-bit type on 64-bit platforms.  The change
    898898will cause incompatibilities on 64-bit machines, so it was deemed worth making
    899899the transition now, while the number of 64-bit users is still relatively small.
     
    903903This change most strongly affects authors of C extension modules.   Python
    904904strings and container types such as lists and tuples  now use
    905 :ctype:`Py_ssize_t` to store their size.   Functions such as
    906 :cfunc:`PyList_Size`  now return :ctype:`Py_ssize_t`.  Code in extension modules
    907 may therefore need to have some variables changed to :ctype:`Py_ssize_t`.
    908 
    909 The :cfunc:`PyArg_ParseTuple` and :cfunc:`Py_BuildValue` functions have a new
    910 conversion code, ``n``, for :ctype:`Py_ssize_t`.   :cfunc:`PyArg_ParseTuple`'s
    911 ``s#`` and ``t#`` still output :ctype:`int` by default, but you can define the
    912 macro  :cmacro:`PY_SSIZE_T_CLEAN` before including :file:`Python.h`  to make
    913 them return :ctype:`Py_ssize_t`.
     905:c:type:`Py_ssize_t` to store their size.   Functions such as
     906:c:func:`PyList_Size`  now return :c:type:`Py_ssize_t`.  Code in extension modules
     907may therefore need to have some variables changed to :c:type:`Py_ssize_t`.
     908
     909The :c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue` functions have a new
     910conversion code, ``n``, for :c:type:`Py_ssize_t`.   :c:func:`PyArg_ParseTuple`'s
     911``s#`` and ``t#`` still output :c:type:`int` by default, but you can define the
     912macro  :c:macro:`PY_SSIZE_T_CLEAN` before including :file:`Python.h`  to make
     913them return :c:type:`Py_ssize_t`.
    914914
    915915:pep:`353` has a section on conversion guidelines that  extension authors should
     
    955955
    956956A corresponding :attr:`nb_index` slot was added to the C-level
    957 :ctype:`PyNumberMethods` structure to let C extensions implement this protocol.
    958 :cfunc:`PyNumber_Index(obj)` can be used in extension code to call the
     957:c:type:`PyNumberMethods` structure to let C extensions implement this protocol.
     958:c:func:`PyNumber_Index(obj)` can be used in extension code to call the
    959959:meth:`__index__` function and retrieve its result.
    960960
     
    11801180
    11811181* The :mod:`re` module got a 1 or 2% speedup by switching to  Python's allocator
    1182   functions instead of the system's  :cfunc:`malloc` and :cfunc:`free`.
     1182  functions instead of the system's  :c:func:`malloc` and :c:func:`free`.
    11831183  (Contributed by Jack Diederich at the NeedForSpeed sprint.)
    11841184
     
    12041204
    12051205* Importing now caches the paths tried, recording whether  they exist or not so
    1206   that the interpreter makes fewer  :cfunc:`open` and :cfunc:`stat` calls on
     1206  that the interpreter makes fewer  :c:func:`open` and :c:func:`stat` calls on
    12071207  startup. (Contributed by Martin von Löwis and Georg Brandl.)
    12081208
     
    13391339  .. XXX need to provide some more detail here
    13401340
     1341  .. index::
     1342     single: universal newlines; What's new
     1343
    13411344* The :mod:`fileinput` module was made more flexible. Unicode filenames are now
    13421345  supported, and a *mode* parameter that defaults to ``"r"`` was added to the
    1343   :func:`input` function to allow opening files in binary or universal-newline
    1344   mode.  Another new parameter, *openhook*, lets you use a function other than
    1345   :func:`open`  to open the input files.  Once you're iterating over  the set of
    1346   files, the :class:`FileInput` object's new :meth:`fileno` returns the file
    1347   descriptor for the currently opened file. (Contributed by Georg Brandl.)
     1346  :func:`input` function to allow opening files in binary or :term:`universal
     1347  newlines` mode.  Another new parameter, *openhook*, lets you use a function
     1348  other than :func:`open`  to open the input files.  Once you're iterating over
     1349  the set of files, the :class:`FileInput` object's new :meth:`fileno` returns
     1350  the file descriptor for the currently opened file. (Contributed by Georg
     1351  Brandl.)
    13481352
    13491353* In the :mod:`gc` module, the new :func:`get_count` function returns a 3-tuple
     
    14601464  On FreeBSD, the :func:`os.stat` function now returns  times with nanosecond
    14611465  resolution, and the returned object now has :attr:`st_gen` and
    1462   :attr:`st_birthtime`. The :attr:`st_flags` member is also available, if the
     1466  :attr:`st_birthtime`. The :attr:`st_flags` attribute is also available, if the
    14631467  platform supports it. (Contributed by Antti Louko and  Diego Pettenò.)
    14641468
     
    15691573
    15701574  This information is also available to C extensions via the
    1571   :cfunc:`Py_GetBuildInfo` function that returns a  string of build information
     1575  :c:func:`Py_GetBuildInfo` function that returns a  string of build information
    15721576  like this: ``"trunk:45355:45356M, Apr 13 2006, 07:42:19"``.   (Contributed by
    15731577  Barry Warsaw.)
     
    16911695
    16921696Type constructors for the various C types are provided: :func:`c_int`,
    1693 :func:`c_float`, :func:`c_double`, :func:`c_char_p` (equivalent to :ctype:`char
     1697:func:`c_float`, :func:`c_double`, :func:`c_char_p` (equivalent to :c:type:`char
    16941698\*`), and so forth.  Unlike Python's types, the C versions are all mutable; you
    16951699can assign to their :attr:`value` attribute to change the wrapped value.  Python
     
    17211725interpreter lock before calling a function, because the lock must be held when
    17221726calling into the interpreter's code.   There's a :class:`py_object()` type
    1723 constructor that will create a  :ctype:`PyObject \*` pointer.  A simple usage::
     1727constructor that will create a  :c:type:`PyObject \*` pointer.  A simple usage::
    17241728
    17251729   import ctypes
     
    17661770
    17671771ElementTree represents an XML document as a tree of element nodes. The text
    1768 content of the document is stored as the :attr:`.text` and :attr:`.tail`
     1772content of the document is stored as the :attr:`text` and :attr:`tail`
    17691773attributes of  (This is one of the major differences between ElementTree and
    17701774the Document Object Model; in the DOM there are many different types of node,
     
    20882092
    20892093* The largest change to the C API came from :pep:`353`, which modifies the
    2090   interpreter to use a :ctype:`Py_ssize_t` type definition instead of
    2091   :ctype:`int`.  See the earlier section :ref:`pep-353` for a discussion of this
     2094  interpreter to use a :c:type:`Py_ssize_t` type definition instead of
     2095  :c:type:`int`.  See the earlier section :ref:`pep-353` for a discussion of this
    20922096  change.
    20932097
     
    21142118  the various AST nodes in :file:`Parser/Python.asdl`.  A Python script reads this
    21152119  file and generates a set of C structure definitions in
    2116   :file:`Include/Python-ast.h`.  The :cfunc:`PyParser_ASTFromString` and
    2117   :cfunc:`PyParser_ASTFromFile`, defined in :file:`Include/pythonrun.h`, take
     2120  :file:`Include/Python-ast.h`.  The :c:func:`PyParser_ASTFromString` and
     2121  :c:func:`PyParser_ASTFromFile`, defined in :file:`Include/pythonrun.h`, take
    21182122  Python source as input and return the root of an AST representing the contents.
    2119   This AST can then be turned into a code object by :cfunc:`PyAST_Compile`.  For
     2123  This AST can then be turned into a code object by :c:func:`PyAST_Compile`.  For
    21202124  more information, read the source code, and then ask questions on python-dev.
    21212125
     
    21392143  Note that this change means extension modules must be more careful when
    21402144  allocating memory.  Python's API has many different functions for allocating
    2141   memory that are grouped into families.  For example, :cfunc:`PyMem_Malloc`,
    2142   :cfunc:`PyMem_Realloc`, and :cfunc:`PyMem_Free` are one family that allocates
    2143   raw memory, while :cfunc:`PyObject_Malloc`, :cfunc:`PyObject_Realloc`, and
    2144   :cfunc:`PyObject_Free` are another family that's supposed to be used for
     2145  memory that are grouped into families.  For example, :c:func:`PyMem_Malloc`,
     2146  :c:func:`PyMem_Realloc`, and :c:func:`PyMem_Free` are one family that allocates
     2147  raw memory, while :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc`, and
     2148  :c:func:`PyObject_Free` are another family that's supposed to be used for
    21452149  creating Python objects.
    21462150
    21472151  Previously these different families all reduced to the platform's
    2148   :cfunc:`malloc` and :cfunc:`free` functions.  This meant  it didn't matter if
    2149   you got things wrong and allocated memory with the :cfunc:`PyMem` function but
    2150   freed it with the :cfunc:`PyObject` function.  With 2.5's changes to obmalloc,
     2152  :c:func:`malloc` and :c:func:`free` functions.  This meant  it didn't matter if
     2153  you got things wrong and allocated memory with the :c:func:`PyMem` function but
     2154  freed it with the :c:func:`PyObject` function.  With 2.5's changes to obmalloc,
    21512155  these families now do different things and mismatches will probably result in a
    21522156  segfault.  You should carefully test your C extension modules with Python 2.5.
    21532157
    2154 * The built-in set types now have an official C API.  Call :cfunc:`PySet_New`
    2155   and :cfunc:`PyFrozenSet_New` to create a new set, :cfunc:`PySet_Add` and
    2156   :cfunc:`PySet_Discard` to add and remove elements, and :cfunc:`PySet_Contains`
    2157   and :cfunc:`PySet_Size` to examine the set's state. (Contributed by Raymond
     2158* The built-in set types now have an official C API.  Call :c:func:`PySet_New`
     2159  and :c:func:`PyFrozenSet_New` to create a new set, :c:func:`PySet_Add` and
     2160  :c:func:`PySet_Discard` to add and remove elements, and :c:func:`PySet_Contains`
     2161  and :c:func:`PySet_Size` to examine the set's state. (Contributed by Raymond
    21582162  Hettinger.)
    21592163
    21602164* C code can now obtain information about the exact revision of the Python
    2161   interpreter by calling the  :cfunc:`Py_GetBuildInfo` function that returns a
     2165  interpreter by calling the  :c:func:`Py_GetBuildInfo` function that returns a
    21622166  string of build information like this: ``"trunk:45355:45356M, Apr 13 2006,
    21632167  07:42:19"``.   (Contributed by Barry Warsaw.)
     
    21652169* Two new macros can be used to indicate C functions that are local to the
    21662170  current file so that a faster calling convention can be used.
    2167   :cfunc:`Py_LOCAL(type)` declares the function as returning a value of the
     2171  :c:func:`Py_LOCAL(type)` declares the function as returning a value of the
    21682172  specified *type* and uses a fast-calling qualifier.
    2169   :cfunc:`Py_LOCAL_INLINE(type)` does the same thing and also requests the
    2170   function be inlined.  If :cfunc:`PY_LOCAL_AGGRESSIVE` is defined before
     2173  :c:func:`Py_LOCAL_INLINE(type)` does the same thing and also requests the
     2174  function be inlined.  If :c:func:`PY_LOCAL_AGGRESSIVE` is defined before
    21712175  :file:`python.h` is included, a set of more aggressive optimizations are enabled
    21722176  for the module; you should benchmark the results to find out if these
     
    21742178  the NeedForSpeed sprint.)
    21752179
    2176 * :cfunc:`PyErr_NewException(name, base, dict)` can now accept a tuple of base
     2180* :c:func:`PyErr_NewException(name, base, dict)` can now accept a tuple of base
    21772181  classes as its *base* argument.  (Contributed by Georg Brandl.)
    21782182
    2179 * The :cfunc:`PyErr_Warn` function for issuing warnings is now deprecated in
    2180   favour of :cfunc:`PyErr_WarnEx(category, message, stacklevel)` which lets you
     2183* The :c:func:`PyErr_Warn` function for issuing warnings is now deprecated in
     2184  favour of :c:func:`PyErr_WarnEx(category, message, stacklevel)` which lets you
    21812185  specify the number of stack frames separating this function and the caller.  A
    2182   *stacklevel* of 1 is the function calling :cfunc:`PyErr_WarnEx`, 2 is the
     2186  *stacklevel* of 1 is the function calling :c:func:`PyErr_WarnEx`, 2 is the
    21832187  function above that, and so forth.  (Added by Neal Norwitz.)
    21842188
     
    21872191  Martin von Löwis, Skip Montanaro.)
    21882192
    2189 * The :cfunc:`PyRange_New` function was removed.  It was never documented, never
     2193* The :c:func:`PyRange_New` function was removed.  It was never documented, never
    21902194  used in the core code, and had dangerously lax error checking.  In the unlikely
    21912195  case that your extensions were using it, you can replace it by something like
     
    22042208
    22052209* MacOS X (10.3 and higher): dynamic loading of modules now uses the
    2206   :cfunc:`dlopen` function instead of MacOS-specific functions.
     2210  :c:func:`dlopen` function instead of MacOS-specific functions.
    22072211
    22082212* MacOS X: an :option:`--enable-universalsdk` switch was added to the
     
    22602264  checking.
    22612265
    2262 * C API: Many functions now use :ctype:`Py_ssize_t`  instead of :ctype:`int` to
     2266* C API: Many functions now use :c:type:`Py_ssize_t`  instead of :c:type:`int` to
    22632267  allow processing more data on 64-bit machines.  Extension code may need to make
    22642268  the same change to avoid warnings and to support 64-bit machines.  See the
     
    22662270
    22672271* C API:  The obmalloc changes mean that  you must be careful to not mix usage
    2268   of the :cfunc:`PyMem_\*` and :cfunc:`PyObject_\*` families of functions. Memory
    2269   allocated with  one family's :cfunc:`\*_Malloc` must be  freed with the
    2270   corresponding family's :cfunc:`\*_Free` function.
     2272  of the :c:func:`PyMem_\*` and :c:func:`PyObject_\*` families of functions. Memory
     2273  allocated with  one family's :c:func:`\*_Malloc` must be  freed with the
     2274  corresponding family's :c:func:`\*_Free` function.
    22712275
    22722276.. ======================================================================
  • python/vendor/current/Doc/whatsnew/2.6.rst

    r2 r388  
    66
    77:Author: A.M. Kuchling (amk at amk.ca)
    8 :Release: |release|
    9 :Date: |today|
    10 
    11 .. $Id: 2.6.rst 78304 2010-02-22 14:55:17Z andrew.kuchling $
     8
     9.. $Id$
    1210   Rules for maintenance:
    1311
     
    110108
    111109Python 3.0 adds several new built-in functions and changes the
    112 semantics of some existing built-ins.  Functions that are new in 3.0
     110semantics of some existing builtins.  Functions that are new in 3.0
    113111such as :func:`bin` have simply been added to Python 2.6, but existing
    114 built-ins haven't been changed; instead, the :mod:`future_builtins`
     112builtins haven't been changed; instead, the :mod:`future_builtins`
    115113module has versions with the new 3.0 semantics.  Code written to be
    116114compatible with 3.0 can do ``from future_builtins import hex, map`` as
     
    122120code to 3.0.  The value of this switch is available
    123121to Python code as the boolean variable :data:`sys.py3kwarning`,
    124 and to C extension code as :cdata:`Py_Py3kWarningFlag`.
     122and to C extension code as :c:data:`Py_Py3kWarningFlag`.
    125123
    126124.. seealso::
     
    233231.. seealso::
    234232
    235    :ref:`documenting-index`
     233   `Documenting Python <http://docs.python.org/devguide/documenting.html>`__
    236234       Describes how to write for Python's documentation.
    237235
     
    612610        print 'Factorial', N, '=', result
    613611
    614 A :class:`Queue` is used to communicate the input parameter *N* and
    615 the result.  The :class:`Queue` object is stored in a global variable.
     612A :class:`Queue` is used to communicate the result of the factorial.
     613The :class:`Queue` object is stored in a global variable.
    616614The child process will use the value of the variable when the child
    617615was created; because it's a :class:`Queue`, parent and child can use
     
    834832           return str(self)
    835833
    836 There's also a :func:`format` built-in that will format a single
     834There's also a :func:`format` builtin that will format a single
    837835value.  It calls the type's :meth:`__format__` method with the
    838836provided specifier::
     
    976974
    977975At the C level, Python 3.0 will rename the existing 8-bit
    978 string type, called :ctype:`PyStringObject` in Python 2.x,
    979 to :ctype:`PyBytesObject`.  Python 2.6 uses ``#define``
    980 to support using the names :cfunc:`PyBytesObject`,
    981 :cfunc:`PyBytes_Check`, :cfunc:`PyBytes_FromStringAndSize`,
     976string type, called :c:type:`PyStringObject` in Python 2.x,
     977to :c:type:`PyBytesObject`.  Python 2.6 uses ``#define``
     978to support using the names :c:func:`PyBytesObject`,
     979:c:func:`PyBytes_Check`, :c:func:`PyBytes_FromStringAndSize`,
    982980and all the other functions and macros used with strings.
    983981
     
    10111009
    10121010There's also a corresponding C API, with
    1013 :cfunc:`PyByteArray_FromObject`,
    1014 :cfunc:`PyByteArray_FromStringAndSize`,
     1011:c:func:`PyByteArray_FromObject`,
     1012:c:func:`PyByteArray_FromStringAndSize`,
    10151013and various other functions.
    10161014
     
    10681066  over an in-memory buffer.
    10691067
     1068  .. index::
     1069     single: universal newlines; What's new
     1070
    10701071* :class:`TextIOBase`: Provides functions for reading and writing
    10711072  strings (remember, strings will be Unicode in Python 3.0),
    1072   and supporting universal newlines.  :class:`TextIOBase` defines
     1073  and supporting :term:`universal newlines`.  :class:`TextIOBase` defines
    10731074  the :meth:`readline` method and supports iteration upon
    10741075  objects.
     
    11311132.. XXX PyObject_GetBuffer not documented in c-api
    11321133
    1133 The *flags* argument to :cfunc:`PyObject_GetBuffer` specifies
     1134The *flags* argument to :c:func:`PyObject_GetBuffer` specifies
    11341135constraints upon the memory returned.  Some examples are:
    11351136
     
    11421143   Fortran-contiguous (first dimension varies the fastest) array layout.
    11431144
    1144 Two new argument codes for :cfunc:`PyArg_ParseTuple`,
     1145Two new argument codes for :c:func:`PyArg_ParseTuple`,
    11451146``s*`` and ``z*``, return locked buffer objects for a parameter.
    11461147
     
    11651166containing a metaclass called :class:`ABCMeta`, special handling of
    11661167this metaclass by the :func:`isinstance` and :func:`issubclass`
    1167 built-ins, and a collection of basic ABCs that the Python developers
     1168builtins, and a collection of basic ABCs that the Python developers
    11681169think will be widely useful.  Future versions of Python will probably
    11691170add more ABCs.
     
    13191320    47
    13201321
    1321 The :func:`oct` built-in still returns numbers
     1322The :func:`oct` builtin still returns numbers
    13221323prefixed with a leading zero, and a new :func:`bin`
    1323 built-in returns the binary representation for a number::
     1324builtin returns the binary representation for a number::
    13241325
    13251326    >>> oct(42)
     
    13301331    '0b10101101'
    13311332
    1332 The :func:`int` and :func:`long` built-ins will now accept the "0o"
     1333The :func:`int` and :func:`long` builtins will now accept the "0o"
    13331334and "0b" prefixes when base-8 or base-2 are requested, or when the
    13341335*base* argument is zero (signalling that the base used should be
     
    14161417and can be used as array indexes and slice boundaries.
    14171418
    1418 In Python 3.0, the PEP slightly redefines the existing built-ins
     1419In Python 3.0, the PEP slightly redefines the existing builtins
    14191420:func:`round`, :func:`math.floor`, :func:`math.ceil`, and adds a new
    14201421one, :func:`math.trunc`, that's been backported to Python 2.6.
     
    15241525  (Contributed by Amaury Forgeot d'Arc; :issue:`3473`.)
    15251526
    1526 * A new built-in, ``next(iterator, [default])`` returns the next item
     1527* A new builtin, ``next(iterator, [default])`` returns the next item
    15271528  from the specified iterator.  If the *default* argument is supplied,
    15281529  it will be returned if *iterator* has been exhausted; otherwise,
     
    16361637  assigning ``None`` was implemented as an override.  At the
    16371638  C level, extensions can set ``tp_hash`` to
    1638   :cfunc:`PyObject_HashNotImplemented`.
     1639  :c:func:`PyObject_HashNotImplemented`.
    16391640  (Fixed by Nick Coghlan and Amaury Forgeot d'Arc; :issue:`2235`.)
    16401641
     
    17061707  the Python core.  Extension modules may not necessarily be compatible with
    17071708  this cache,
    1708   so they must explicitly add :cmacro:`Py_TPFLAGS_HAVE_VERSION_TAG`
     1709  so they must explicitly add :c:macro:`Py_TPFLAGS_HAVE_VERSION_TAG`
    17091710  to the module's ``tp_flags`` field to enable the method cache.
    17101711  (To be compatible with the method cache, the extension module's code
     
    17891790  one patch.)
    17901791
    1791 * The :mod:`bsddb` module also has a new maintainer, Jesús Cea, and the package
     1792* The :mod:`bsddb` module also has a new maintainer, Jesús Cea Avion, and the package
    17921793  is now available as a standalone package.  The web page for the package is
    17931794  `www.jcea.es/programacion/pybsddb.htm
     
    19531954
    19541955* The :func:`reduce` built-in function is also available in the
    1955   :mod:`functools` module.  In Python 3.0, the built-in has been
     1956  :mod:`functools` module.  In Python 3.0, the builtin has been
    19561957  dropped and :func:`reduce` is only available from :mod:`functools`;
    1957   currently there are no plans to drop the built-in in the 2.x series.
     1958  currently there are no plans to drop the builtin in the 2.x series.
    19581959  (Patched by Christian Heimes; :issue:`1739906`.)
    19591960
     
    21922193  For example, ``os.path.splitext('.ipython')``
    21932194  now returns ``('.ipython', '')`` instead of ``('', '.ipython')``.
    2194   (:issue:`115886`)
     2195  (:issue:`1115886`)
    21952196
    21962197  A new function, ``os.path.relpath(path, start='.')``, returns a relative path
     
    22852286
    22862287* The :mod:`select` module now has wrapper functions
    2287   for the Linux :cfunc:`epoll` and BSD :cfunc:`kqueue` system calls.
     2288  for the Linux :c:func:`epoll` and BSD :c:func:`kqueue` system calls.
    22882289  :meth:`modify` method was added to the existing :class:`poll`
    22892290  objects; ``pollobj.modify(fd, eventmask)`` takes a file descriptor
     
    23182319  to be used; when a signal is received, a byte is written to that
    23192320  file descriptor.  There's also a C-level function,
    2320   :cfunc:`PySignal_SetWakeupFd`, for setting the descriptor.
     2321  :c:func:`PySignal_SetWakeupFd`, for setting the descriptor.
    23212322
    23222323  Event loops will use this by opening a pipe to create two descriptors,
     
    23242325  will be passed to :func:`set_wakeup_fd`, and the readable descriptor
    23252326  will be added to the list of descriptors monitored by the event loop via
    2326   :cfunc:`select` or :cfunc:`poll`.
     2327  :c:func:`select` or :c:func:`poll`.
    23272328  On receiving a signal, a byte will be written and the main event loop
    23282329  will be woken up, avoiding the need to poll.
     
    23852386  version 2.4.1.
    23862387
    2387 * The :mod:`struct` module now supports the C99 :ctype:`_Bool` type,
     2388* The :mod:`struct` module now supports the C99 :c:type:`_Bool` type,
    23882389  using the format character ``'?'``.
    23892390  (Contributed by David Remahl.)
     
    23932394  On Windows, :meth:`send_signal` only supports the :const:`SIGTERM`
    23942395  signal, and all these methods are aliases for the Win32 API function
    2395   :cfunc:`TerminateProcess`.
     2396  :c:func:`TerminateProcess`.
    23962397  (Contributed by Christian Heimes.)
    23972398
     
    27572758* ``filter(predicate, iterable)``,
    27582759  ``map(func, iterable1, ...)``: the 3.0 versions
    2759   return iterators, unlike the 2.x built-ins which return lists.
     2760  return iterators, unlike the 2.x builtins which return lists.
    27602761
    27612762* ``hex(value)``, ``oct(value)``: instead of calling the
     
    29782979* Python now must be compiled with C89 compilers (after 19
    29792980  years!).  This means that the Python source tree has dropped its
    2980   own implementations of :cfunc:`memmove` and :cfunc:`strerror`, which
     2981  own implementations of :c:func:`memmove` and :c:func:`strerror`, which
    29812982  are in the C89 standard library.
    29822983
     
    30003001* The new buffer interface, previously described in
    30013002  `the PEP 3118 section <#pep-3118-revised-buffer-protocol>`__,
    3002   adds :cfunc:`PyObject_GetBuffer` and :cfunc:`PyBuffer_Release`,
     3003  adds :c:func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release`,
    30033004  as well as a few other functions.
    30043005
     
    30083009  was reading from or writing to the object.  In 2.6 file objects
    30093010  have a reference count, manipulated by the
    3010   :cfunc:`PyFile_IncUseCount` and :cfunc:`PyFile_DecUseCount`
     3011  :c:func:`PyFile_IncUseCount` and :c:func:`PyFile_DecUseCount`
    30113012  functions.  File objects can't be closed unless the reference count
    3012   is zero.  :cfunc:`PyFile_IncUseCount` should be called while the GIL
     3013  is zero.  :c:func:`PyFile_IncUseCount` should be called while the GIL
    30133014  is still held, before carrying out an I/O operation using the
    3014   ``FILE *`` pointer, and :cfunc:`PyFile_DecUseCount` should be called
     3015  ``FILE *`` pointer, and :c:func:`PyFile_DecUseCount` should be called
    30153016  immediately after the GIL is re-acquired.
    30163017  (Contributed by Antoine Pitrou and Gregory P. Smith.)
     
    30183019* Importing modules simultaneously in two different threads no longer
    30193020  deadlocks; it will now raise an :exc:`ImportError`.  A new API
    3020   function, :cfunc:`PyImport_ImportModuleNoBlock`, will look for a
     3021  function, :c:func:`PyImport_ImportModuleNoBlock`, will look for a
    30213022  module in ``sys.modules`` first, then try to import it after
    30223023  acquiring an import lock.  If the import lock is held by another
     
    30253026
    30263027* Several functions return information about the platform's
    3027   floating-point support.  :cfunc:`PyFloat_GetMax` returns
     3028  floating-point support.  :c:func:`PyFloat_GetMax` returns
    30283029  the maximum representable floating point value,
    3029   and :cfunc:`PyFloat_GetMin` returns the minimum
    3030   positive value.  :cfunc:`PyFloat_GetInfo` returns an object
     3030  and :c:func:`PyFloat_GetMin` returns the minimum
     3031  positive value.  :c:func:`PyFloat_GetInfo` returns an object
    30313032  containing more information from the :file:`float.h` file, such as
    30323033  ``"mant_dig"`` (number of digits in the mantissa), ``"epsilon"``
     
    30363037
    30373038* C functions and methods that use
    3038   :cfunc:`PyComplex_AsCComplex` will now accept arguments that
     3039  :c:func:`PyComplex_AsCComplex` will now accept arguments that
    30393040  have a :meth:`__complex__` method.  In particular, the functions in the
    30403041  :mod:`cmath` module will now accept objects with this method.
     
    30503051  integers and strings to the module's dictionary in the
    30513052  ``init*`` function.  Python 2.6 finally defines standard macros
    3052   for adding values to a module, :cmacro:`PyModule_AddStringMacro`
    3053   and :cmacro:`PyModule_AddIntMacro()`.  (Contributed by
     3053  for adding values to a module, :c:macro:`PyModule_AddStringMacro`
     3054  and :c:macro:`PyModule_AddIntMacro()`.  (Contributed by
    30543055  Christian Heimes.)
    30553056
    30563057* Some macros were renamed in both 3.0 and 2.6 to make it clearer that
    30573058  they are macros,
    3058   not functions.  :cmacro:`Py_Size()` became :cmacro:`Py_SIZE()`,
    3059   :cmacro:`Py_Type()` became :cmacro:`Py_TYPE()`, and
    3060   :cmacro:`Py_Refcnt()` became :cmacro:`Py_REFCNT()`.
     3059  not functions.  :c:macro:`Py_Size()` became :c:macro:`Py_SIZE()`,
     3060  :c:macro:`Py_Type()` became :c:macro:`Py_TYPE()`, and
     3061  :c:macro:`Py_Refcnt()` became :c:macro:`Py_REFCNT()`.
    30613062  The mixed-case macros are still available
    30623063  in Python 2.6 for backward compatibility.
     
    31163117* The :mod:`socket` module's socket objects now have an
    31173118  :meth:`ioctl` method that provides a limited interface to the
    3118   :cfunc:`WSAIoctl` system interface.
     3119  :c:func:`WSAIoctl` system interface.
    31193120
    31203121* The :mod:`_winreg` module now has a function,
     
    32623263  an :exc:`ImportError`.
    32633264
    3264 * C API: the :cfunc:`PyImport_Import` and :cfunc:`PyImport_ImportModule`
     3265* C API: the :c:func:`PyImport_Import` and :c:func:`PyImport_ImportModule`
    32653266  functions now default to absolute imports, not relative imports.
    32663267  This will affect C extensions that import other modules.
     
    32683269* C API: extension data types that shouldn't be hashable
    32693270  should define their ``tp_hash`` slot to
    3270   :cfunc:`PyObject_HashNotImplemented`.
     3271  :c:func:`PyObject_HashNotImplemented`.
    32713272
    32723273* The :mod:`socket` module exception :exc:`socket.error` now inherits
  • python/vendor/current/Doc/whatsnew/index.rst

    r2 r388  
    1212   :maxdepth: 2
    1313
     14   2.7.rst
    1415   2.6.rst
    1516   2.5.rst
Note: See TracChangeset for help on using the changeset viewer.