Lines Matching +full:intel +full:- +full:gpg +full:- +full:keys
9 .. $Id: whatsnew25.tex 56611 2007-07-29 08:26:10Z georg.brandl $
18 community, I think, because several widely-useful packages were added. New
26 see section :ref:`pep-308`. The new ':keyword:`with`' statement will make
27 writing cleanup code easier (section :ref:`pep-343`). Values can now be passed
28 into generators (section :ref:`pep-342`). Imports are now visible as either
29 absolute or relative (section :ref:`pep-328`). Some corner cases of exception
30 handling are handled better (section :ref:`pep-341`). All these improvements
46 e-mail them to the author or open a bug in the Python bug tracker.
51 .. _pep-308:
66 There have been endless tedious discussions of syntax on both python-dev and
102 # First version -- no parens
105 # Second version -- with parens
122 :pep:`308` - Conditional Expressions
129 .. _pep-309:
134 The :mod:`functools` module is intended to contain tools for functional-style
146 invoke *function* with the filled-in arguments.
160 Here's another example, from a program that uses PyGTK. Here a context-sensitive
161 pop-up menu is being constructed dynamically. The callback provided
175 well-behaved decorators. :func:`update_wrapper` copies the name, module, and
200 :pep:`309` - Partial Function Application
201 PEP proposed and written by Peter Harris; implemented by Hye-Shik Chang and Nick
207 .. _pep-314:
215 the dependency information will be recorded in the :file:`PKG-INFO` file.
227 download_url=('http://www.example.com/pypackage/dist/pkg-%s.tar.gz'
239 GPG-sign the package by supplying the :option:`!--sign` and :option:`!--identity`
247 :pep:`314` - Metadata for Python Software Packages v1.1
254 .. _pep-328:
264 can be specified to use absolute or package-relative imports. The plan is to
300 using a ``from __future__ import absolute_import`` directive. This absolute-import
330 :pep:`328` - Imports: Multi-Line and Absolute/Relative
339 .. _pep-338:
344 The :option:`-m` switch added in Python 2.4 to execute a module as a script
353 ``sys.path`` and then use the :option:`-m` switch to execute code from the
359 :pep:`338` - Executing modules as scripts
365 .. _pep-341:
383 block-1 ...
385 handler-1 ...
387 handler-2 ...
389 else-block
391 final-block
393 The code in *block-1* is executed. If the code raises an exception, the various
395 :class:`Exception1`, *handler-1* is executed; otherwise if it's of class
396 :class:`Exception2`, *handler-2* is executed, and so forth. If no exception is
397 raised, the *else-block* is executed.
399 No matter what happened previously, the *final-block* is executed once the code
401 an exception handler or the *else-block* and a new exception is raised, the code
402 in the *final-block* is still run.
407 :pep:`341` - Unifying try-except and try-finally
413 .. _pep-342:
452 -expression must always be parenthesized except when it occurs at the top-level
453 expression on the right-hand side of an assignment. This means you can write
509 Python's garbage collector when the generator is garbage-collected.
514 The cumulative effect of these changes is to turn generators from one-way
524 :meth:`close` is called when a generator is garbage-collected, so this means the
543 :pep:`342` - Coroutines via Enhanced Generators
559 .. _pep-343:
565 ``try...finally`` blocks to ensure that clean-up code is executed. In this
570 The ':keyword:`with`' statement is a new control-flow structure whose basic
574 with-block
580 The object's :meth:`__enter__` is called before *with-block* is executed and
581 therefore can run set-up code. It also may return a value that is bound to the
585 After execution of the *with-block* is finished, the object's :meth:`__exit__`
587 clean-up code.
606 part-way through the block.
640 .. _new-25-context-managers:
643 ------------------------
651 A high-level explanation of the context management protocol is:
666 is re-raised: any false value re-raises the exception, and ``True`` will result
724 will be re-raised automatically. If you wished, you could be more explicit and
742 ---------------------
798 :pep:`343` - The "with" statement
809 .. _pep-352:
811 PEP 352: Exceptions as New-Style Classes
814 Exception classes can now be new-style classes, not just classic classes, and
815 the built-in :exc:`Exception` class and all the standard built-in exceptions
816 (:exc:`NameError`, :exc:`ValueError`, etc.) are now new-style classes.
822 |- KeyboardInterrupt
823 |- SystemExit
824 |- Exception
825 |- (all other current built-in exceptions)
830 hitting :kbd:`Control-C` or code calling :func:`sys.exit`. A bare ``except:`` will
832 :exc:`SystemExit` in order to re-raise them. The usual pattern is::
857 to be able to remove the string-exception feature in a few releases.
862 :pep:`352` - Required Superclass for Exceptions
868 .. _pep-353:
873 A wide-ranging change to Python's C API, using a new :c:type:`Py_ssize_t` type
875 data on 64-bit platforms. This change doesn't affect Python's capacity on 32-bit
880 in 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
882 ``2**31 - 1`` = 2147483647 items. (There are actually a few different
883 programming models that 64-bit C compilers can use -- see
884 http://www.unix.org/version2/whatsnew/lp64_wp.html for a discussion -- but the
887 A limit of 2147483647 items doesn't really matter on a 32-bit platform because
891 than a 32-bit address space can contain.
893 It's possible to address that much memory on a 64-bit platform, however. The
897 :c:type:`int`, and this will be a 64-bit type on 64-bit platforms. The change
898 will cause incompatibilities on 64-bit machines, so it was deemed worth making
899 the transition now, while the number of 64-bit users is still relatively small.
900 (In 5 or 10 years, we may *all* be on 64-bit machines, and the transition would
916 read to learn about supporting 64-bit platforms.
921 :pep:`353` - Using ssize_t as the index type
927 .. _pep-357:
942 :meth:`__int__`, floating-point numbers would also become legal slice indexes
956 A corresponding :attr:`nb_index` slot was added to the C-level
964 :pep:`357` - Allowing Any Object to be Used for Slicing
970 .. _other-lang:
992 * Both 8-bit and Unicode strings have new ``partition(sep)`` and
998 returns a 3-tuple containing the substring before the separator, the separator
1001 are empty. ``rpartition(sep)`` also returns a 3-tuple but starts searching
1029 * The :func:`min` and :func:`max` built-in functions gained a ``key`` keyword
1044 * Two new built-in functions, :func:`any` and :func:`all`, evaluate whether an
1054 regular integer, but in 2.5 the :func:`id` built-in was changed to always
1055 return non-negative numbers, and users often seem to use ``id(self)`` in
1061 module contains string literals with 8-bit characters but doesn't have an
1066 # -*- coding: latin1 -*-
1069 compare a Unicode string and an 8-bit string that can't be converted to Unicode
1074 to convert both arguments to Unicode - interpreting them
1090 (Implemented by Marc-André Lemburg.)
1094 confusing, and usually requires running Python with the :option:`-v` switch to
1098 provide the :option:`-Wd <-W>` option when running the Python executable to display
1115 -------------------------------
1121 'Use Ctrl-D (i.e. EOF) to exit.'
1128 The Python executable now accepts the standard long options :option:`--help`
1129 and :option:`--version`; on Windows, it also accepts the :option:`/? <-?>` option
1138 -------------
1141 held in Reykjavik, Iceland, from May 21--28 2006. The sprint focused on speed
1146 * When they were introduced in Python 2.4, the built-in :class:`set` and
1162 around 800--1000 digits where the function is 6 times faster. (Contributed by
1200 * Python's built-in exceptions are now new-style classes, a change that speeds
1224 * The :mod:`audioop` module now supports the a-LAW encoding, and the code for
1225 u-LAW encoding has been improved. (Contributed by Lars Immisch.)
1229 of a tuple. :class:`CodecInfo` instances behave like a 4-tuple to preserve
1234 entire input was fed to the non-incremental codec. See the :mod:`codecs` module
1246 function receives no arguments, so you can use built-in type constructors such
1270 * The :class:`deque` double-ended queue type supplied by the :mod:`collections`
1291 * The :mod:`csv` module, which parses files in comma-separated value format,
1295 argument will return the currently-set limit. The :class:`reader` class now has
1300 The CSV parser is now stricter about multi-line quoted fields. Previously, if a
1317 ts = datetime.strptime('10:13:15 2006-03-07',
1318 '%H:%M:%S %Y-%m-%d')
1331 easier to use non-ASCII characters in tests contained within a docstring.
1353 * In the :mod:`gc` module, the new :func:`get_count` function returns a 3-tuple
1408 The following example converts a maildir-format mailbox into an mbox-format
1460 3-tuple of *process-id*, *exit-status*, *resource-usage* as returned from the
1487 packages stored in ZIP-format archives. (Contributed by Phillip J. Eby.)
1489 * The pybench benchmark suite by Marc-André Lemburg is now included in the
1510 * Also deleted: the :file:`lib-old` directory, which includes ancient modules
1511 such as :mod:`dircmp` and :mod:`ni`, was removed. :file:`lib-old` wasn't on the
1516 :mod:`readline` module and therefore now works on non-Unix platforms. (Patch
1522 :attr:`rpc_paths` attribute that constrains XML-RPC operations to a limited set
1529 thanks to a patch from Philippe Biondi. Netlink sockets are a Linux-specific
1530 mechanism for communications between a user-space process and kernel code; an
1538 means you can put the data directly into an array or a memory-mapped file.
1550 objects. You can still use the module-level :func:`pack` and :func:`unpack`
1562 memory-mapped file.
1570 the ``sys.subversion`` variable, a 3-tuple of ``(interpreter-name, branch-name,
1571 revision-range)``. For example, at the time of writing my copy of 2.5 was
1617 UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')
1621 UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')
1625 UUID('16fd2706-8baf-433b-82eb-8c7fada847da')
1627 >>> # make a UUID using a SHA-1 hash of a namespace UUID and a name
1629 UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
1631 (Contributed by Ka-Ping Yee.)
1641 usable as a script with ``python -m webbrowser``, taking a URL as the argument;
1642 there are a number of switches to control the behaviour (:option:`!-n` for a new
1643 browser window, :option:`!-t` for a new tab). New module-level functions,
1653 for the XML-RPC date type. Supply ``use_datetime=True`` to the :func:`loads`
1675 .. _module-ctypes:
1678 ------------------
1682 libraries or DLLs. Long-time users may remember the :mod:`dl` module, which
1718 -1783957616
1740 distribution hand-coded extension modules because you can't rely on
1756 .. _module-etree:
1759 -----------------------
1769 http://effbot.org/zone/element-index.htm.
1778 string (assumed to contain a filename) or a file-like object and returns an
1783 tree = ET.parse('ex-1.xml')
1802 Each XML element supports some dictionary-like and some list-like access
1803 methods. Dictionary-like operations are used to access attribute values, and
1804 list-like operations are used to access child nodes.
1806 +-------------------------------+--------------------------------------------+
1810 +-------------------------------+--------------------------------------------+
1813 +-------------------------------+--------------------------------------------+
1815 +-------------------------------+--------------------------------------------+
1817 +-------------------------------+--------------------------------------------+
1819 +-------------------------------+--------------------------------------------+
1821 +-------------------------------+--------------------------------------------+
1823 +-------------------------------+--------------------------------------------+
1824 | ``elem.keys()`` | Returns list of attribute names. |
1825 +-------------------------------+--------------------------------------------+
1827 +-------------------------------+--------------------------------------------+
1829 +-------------------------------+--------------------------------------------+
1832 +-------------------------------+--------------------------------------------+
1834 +-------------------------------+--------------------------------------------+
1845 Like :func:`parse`, it can take either a string or a file-like object::
1847 # Encoding is US-ASCII
1850 # Encoding is UTF-8
1852 tree.write(f, encoding='utf-8')
1858 specify a different encoding such as UTF-8 that can handle any Unicode
1867 http://effbot.org/zone/element-index.htm
1873 .. _module-hashlib:
1876 -------------------
1880 additional secure hashes (SHA-224, SHA-256, SHA-384, and SHA-512). When
1927 .. _module-sqlite:
1930 -------------------
1936 SQLite is a C library that provides a lightweight disk-based database that
1944 with the DB-API 2.0 specification described by :pep:`249`.
1971 values ('2006-01-05','BUY','RHAT',100,35.14)""")
1977 Instead, use the DB-API's parameter substitution. Put ``?`` as a placeholder
1982 # Never do this -- insecure!
1991 for t in (('2006-03-28', 'BUY', 'IBM', 1000, 45.00),
1992 ('2006-04-05', 'BUY', 'MSOFT', 1000, 72.00),
1993 ('2006-04-06', 'SELL', 'IBM', 500, 53.00),
2009 (u'2006-01-05', u'BUY', u'RHAT', 100, 35.140000000000001)
2010 (u'2006-03-28', u'BUY', u'IBM', 1000, 45.0)
2011 (u'2006-04-06', u'SELL', u'IBM', 500, 53.0)
2012 (u'2006-04-05', u'BUY', u'MSOFT', 1000, 72.0)
2030 :pep:`249` - Database API Specification 2.0
2031 PEP written by Marc-André Lemburg.
2036 .. _module-wsgiref:
2039 -------------------
2068 A central web site for WSGI-related resources.
2070 :pep:`333` - Python Web Server Gateway Interface v1.0
2076 .. _build-api:
2090 refcounting problems, often occurring in error-handling code. See
2095 :c:type:`int`. See the earlier section :ref:`pep-353` for a discussion of this
2104 :func:`compile` built-in and specifying ``_ast.PyCF_ONLY_AST`` as the value of
2120 :file:`Include/Python-ast.h`. The :c:func:`PyParser_ASTFromString` and
2124 more information, read the source code, and then ask questions on python-dev.
2132 .. List of names taken from Jeremy's python-dev post at
2133 .. https://mail.python.org/pipermail/python-dev/2005-October/057500.html
2136 was applied. Python 2.4 allocated small objects in 256K-sized arenas, but never
2158 * The built-in set types now have an official C API. Call :c:func:`PySet_New`
2172 specified *type* and uses a fast-calling qualifier.
2206 Port-Specific Changes
2207 ---------------------
2210 :c:func:`dlopen` function instead of MacOS-specific functions.
2212 * MacOS X: an :option:`!--enable-universalsdk` switch was added to the
2214 able to run on both PowerPC and Intel processors. (Contributed by Ronald
2233 module contains string literals with 8-bit characters but doesn't have an
2238 object. Because of the :pep:`342` changes described in section :ref:`pep-342`,
2242 compare a Unicode string and an 8-bit string that can't be converted to Unicode
2246 * Library: the :mod:`csv` module is now stricter about multi-line quoted fields.
2261 have a :attr:`rpc_paths` attribute that constrains XML-RPC operations to a
2267 allow processing more data on 64-bit machines. Extension code may need to make
2268 the same change to avoid warnings and to support 64-bit machines. See the
2269 earlier section :ref:`pep-353` for a discussion of this change.
2285 Grosse-Kunstleve, Kent Johnson, Iain Lowe, Martin von Löwis, Fredrik Lundh, Andrew