Changeset 391 for python/trunk/Doc/whatsnew/2.4.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/whatsnew/2.4.rst
r2 r391 412 412 subprocess and the parent. 413 413 414 .. index:: 415 single: universal newlines; What's new 416 414 417 The constructor has a number of handy options: 415 418 … … 425 428 426 429 * *universal_newlines* opens the child's input and output using Python's 427 universal newlinefeature.430 :term:`universal newlines` feature. 428 431 429 432 Once you've created the :class:`Popen` instance, you can call its :meth:`wait` … … 471 474 472 475 Python has always supported floating-point (FP) numbers, based on the underlying 473 C :c type:`double` type, as a data type. However, while most programming476 C :c:type:`double` type, as a data type. However, while most programming 474 477 languages provide a floating-point type, many people (even programmers) are 475 478 unaware that floating-point numbers don't represent certain decimal fractions … … 500 503 501 504 Modern systems usually provide floating-point support that conforms to a 502 standard called IEEE 754. C's :c type:`double` type is usually implemented as a505 standard called IEEE 754. C's :c:type:`double` type is usually implemented as a 503 506 64-bit IEEE 754 number, which uses 52 bits of space for the mantissa. This 504 507 means that numbers can only be specified to 52 bits of precision. If you're … … 738 741 functions in Python's implementation required that the numeric locale remain set 739 742 to the ``'C'`` locale. Often this was because the code was using the C 740 library's :c func:`atof` function.743 library's :c:func:`atof` function. 741 744 742 745 Not setting the numeric locale caused trouble for extensions that used third- … … 748 751 API that perform ASCII-only conversions, ignoring the locale setting: 749 752 750 * :c func:`PyOS_ascii_strtod(str, ptr)` and :cfunc:`PyOS_ascii_atof(str, ptr)`751 both convert a string to a C :c type:`double`.752 753 * :c func:`PyOS_ascii_formatd(buffer, buf_len, format, d)` converts a754 :c type:`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. 755 758 756 759 The code for these functions came from the GLib library … … 940 943 space efficiency. Appending and popping from lists now runs faster due to more 941 944 efficient code paths and less frequent use of the underlying system 942 :c func:`realloc`. List comprehensions also benefit. :meth:`list.extend` was945 :c:func:`realloc`. List comprehensions also benefit. :meth:`list.extend` was 943 946 also optimized and no longer converts its argument into a temporary list before 944 947 extending the base list. (Contributed by Raymond Hettinger.) … … 949 952 950 953 * The methods :meth:`list.__getitem__`, :meth:`dict.__getitem__`, and 951 :meth:`dict.__contains__` are arenow implemented as :class:`method_descriptor`954 :meth:`dict.__contains__` are now implemented as :class:`method_descriptor` 952 955 objects rather than :class:`wrapper_descriptor` objects. This form of access 953 956 doubles their performance and makes them more suitable for use as arguments to … … 1068 1071 3.0 version of the package uses a new incremental parser for MIME messages, 1069 1072 available in the :mod:`email.FeedParser` module. The new parser doesn't require 1070 reading the entire message into memory, and doesn't throwexceptions if a1073 reading the entire message into memory, and doesn't raise exceptions if a 1071 1074 message is malformed; instead it records any problems in the :attr:`defect` 1072 1075 attribute of the message. (Developed by Anthony Baxter, Barry Warsaw, Thomas … … 1447 1450 1448 1451 * Three new convenience macros were added for common return values from 1449 extension functions: :c macro:`Py_RETURN_NONE`, :cmacro:`Py_RETURN_TRUE`, and1450 :c macro:`Py_RETURN_FALSE`. (Contributed by Brett Cannon.)1451 1452 * Another new macro, :c macro:`Py_CLEAR(obj)`, decreases the reference count of1452 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 1453 1456 *obj* and sets *obj* to the null pointer. (Contributed by Jim Fulton.) 1454 1457 1455 * A new function, :c func:`PyTuple_Pack(N, obj1, obj2, ..., objN)`, constructs1458 * A new function, :c:func:`PyTuple_Pack(N, obj1, obj2, ..., objN)`, constructs 1456 1459 tuples from a variable length argument list of Python objects. (Contributed by 1457 1460 Raymond Hettinger.) 1458 1461 1459 * A new function, :c func:`PyDict_Contains(d, k)`, implements fast dictionary1462 * A new function, :c:func:`PyDict_Contains(d, k)`, implements fast dictionary 1460 1463 lookups without masking exceptions raised during the look-up process. 1461 1464 (Contributed by Raymond Hettinger.) 1462 1465 1463 * The :c macro:`Py_IS_NAN(X)` macro returns 1 if its float or double argument1466 * The :c:macro:`Py_IS_NAN(X)` macro returns 1 if its float or double argument 1464 1467 *X* is a NaN. (Contributed by Tim Peters.) 1465 1468 1466 1469 * C code can avoid unnecessary locking by using the new 1467 :c func:`PyEval_ThreadsInitialized` function to tell if any thread operations1470 :c:func:`PyEval_ThreadsInitialized` function to tell if any thread operations 1468 1471 have been performed. If this function returns false, no lock operations are 1469 1472 needed. (Contributed by Nick Coghlan.) 1470 1473 1471 * A new function, :c func:`PyArg_VaParseTupleAndKeywords`, is the same as1472 :c func:`PyArg_ParseTupleAndKeywords` but takes a :ctype:`va_list` instead of a1474 * 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 1473 1476 number of arguments. (Contributed by Greg Chapman.) 1474 1477 1475 1478 * A new method flag, :const:`METH_COEXISTS`, allows a function defined in slots 1476 to co-exist with a :c type:`PyCFunction` having the same name. This can halve1479 to co-exist with a :c:type:`PyCFunction` having the same name. This can halve 1477 1480 the access time for a method such as :meth:`set.__contains__`. (Contributed by 1478 1481 Raymond Hettinger.) … … 1488 1491 register". (Contributed by Jeremy Hylton.) 1489 1492 1490 * The :c type:`tracebackobject` type has been renamed to1491 :c type:`PyTracebackObject`.1493 * The :c:type:`tracebackobject` type has been renamed to 1494 :c:type:`PyTracebackObject`. 1492 1495 1493 1496 .. ====================================================================== … … 1556 1559 1557 1560 The 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 1561 corrections and assistance with various drafts of this article: Koray Can, 1562 Hye-Shik Chang, Michael Dyck, Raymond Hettinger, Brian Hurt, Hamish Lawson, 1563 Fredrik Lundh, Sean Reifschneider, Sadruddin Rejeb. 1564
Note:
See TracChangeset
for help on using the changeset viewer.