Lines Matching +full:intel +full:- +full:gpg +full:- +full:keys
9 .. $Id: whatsnew25.tex 56611 2007-07-29 08:26:10Z georg.brandl $
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 :keyword:`yield`\ -expression must always be parenthesized except when it
453 occurs at the top-level
454 expression on the right-hand side of an assignment. This means you can write
510 Python's garbage collector when the generator is garbage-collected.
515 The cumulative effect of these changes is to turn generators from one-way
525 :meth:`close` is called when a generator is garbage-collected, so this means the
544 :pep:`342` - Coroutines via Enhanced Generators
560 .. _pep-343:
566 ``try...finally`` blocks to ensure that clean-up code is executed. In this
571 The ':keyword:`with`' statement is a new control-flow structure whose basic
575 with-block
581 The object's :meth:`__enter__` is called before *with-block* is executed and
582 therefore can run set-up code. It also may return a value that is bound to the
586 After execution of the *with-block* is finished, the object's :meth:`__exit__`
588 clean-up code.
607 part-way through the block.
641 .. _new-25-context-managers:
644 ------------------------
652 A high-level explanation of the context management protocol is:
667 is re-raised: any false value re-raises the exception, and ``True`` will result
725 will be re-raised automatically. If you wished, you could be more explicit and
743 ---------------------
799 :pep:`343` - The "with" statement
810 .. _pep-352:
812 PEP 352: Exceptions as New-Style Classes
815 Exception classes can now be new-style classes, not just classic classes, and
816 the built-in :exc:`Exception` class and all the standard built-in exceptions
817 (:exc:`NameError`, :exc:`ValueError`, etc.) are now new-style classes.
823 |- KeyboardInterrupt
824 |- SystemExit
825 |- Exception
826 |- (all other current built-in exceptions)
831 hitting :kbd:`Control-C` or code calling :func:`sys.exit`. A bare ``except:`` will
833 :exc:`SystemExit` in order to re-raise them. The usual pattern is::
858 to be able to remove the string-exception feature in a few releases.
863 :pep:`352` - Required Superclass for Exceptions
869 .. _pep-353:
874 A wide-ranging change to Python's C API, using a new :c:type:`Py_ssize_t` type
876 data on 64-bit platforms. This change doesn't affect Python's capacity on 32-bit
881 in an :c:expr:`int`. The C compilers for most 64-bit platforms still define
882 :c:expr:`int` as a 32-bit type, so that meant that lists could only hold up to
883 ``2**31 - 1`` = 2147483647 items. (There are actually a few different
884 programming models that 64-bit C compilers can use -- see
885 https://unix.org/version2/whatsnew/lp64_wp.html for a discussion -- but the
888 A limit of 2147483647 items doesn't really matter on a 32-bit platform because
892 than a 32-bit address space can contain.
894 It's possible to address that much memory on a 64-bit platform, however. The
898 :c:expr:`int`, and this will be a 64-bit type on 64-bit platforms. The change
899 will cause incompatibilities on 64-bit machines, so it was deemed worth making
900 the transition now, while the number of 64-bit users is still relatively small.
901 (In 5 or 10 years, we may *all* be on 64-bit machines, and the transition would
917 read to learn about supporting 64-bit platforms.
922 :pep:`353` - Using ssize_t as the index type
928 .. _pep-357:
943 :meth:`__int__`, floating-point numbers would also become legal slice indexes
957 A corresponding :attr:`nb_index` slot was added to the C-level
965 :pep:`357` - Allowing Any Object to be Used for Slicing
971 .. _other-lang:
993 * Both 8-bit and Unicode strings have new ``partition(sep)`` and
999 returns a 3-tuple containing the substring before the separator, the separator
1002 are empty. ``rpartition(sep)`` also returns a 3-tuple but starts searching
1030 * The :func:`min` and :func:`max` built-in functions gained a ``key`` keyword
1045 * Two new built-in functions, :func:`any` and :func:`all`, evaluate whether an
1055 regular integer, but in 2.5 the :func:`id` built-in was changed to always
1056 return non-negative numbers, and users often seem to use ``id(self)`` in
1062 module contains string literals with 8-bit characters but doesn't have an
1067 # -*- coding: latin1 -*-
1070 compare a Unicode string and an 8-bit string that can't be converted to Unicode
1075 to convert both arguments to Unicode - interpreting them
1091 (Implemented by Marc-André Lemburg.)
1095 confusing, and usually requires running Python with the :option:`-v` switch to
1099 provide the :option:`-Wd <-W>` option when running the Python executable to display
1116 -------------------------------
1122 'Use Ctrl-D (i.e. EOF) to exit.'
1129 The Python executable now accepts the standard long options :option:`--help`
1130 and :option:`--version`; on Windows, it also accepts the :option:`/? <-?>` option
1139 -------------
1142 held in Reykjavik, Iceland, from May 21--28 2006. The sprint focused on speed
1147 * When they were introduced in Python 2.4, the built-in :class:`set` and
1163 around 800--1000 digits where the function is 6 times faster. (Contributed by
1201 * Python's built-in exceptions are now new-style classes, a change that speeds
1225 * The :mod:`audioop` module now supports the a-LAW encoding, and the code for
1226 u-LAW encoding has been improved. (Contributed by Lars Immisch.)
1230 of a tuple. :class:`CodecInfo` instances behave like a 4-tuple to preserve
1235 entire input was fed to the non-incremental codec. See the :mod:`codecs` module
1247 function receives no arguments, so you can use built-in type constructors such
1271 * The :class:`deque` double-ended queue type supplied by the :mod:`collections`
1292 * The :mod:`csv` module, which parses files in comma-separated value format,
1301 The CSV parser is now stricter about multi-line quoted fields. Previously, if a
1318 ts = datetime.strptime('10:13:15 2006-03-07',
1319 '%H:%M:%S %Y-%m-%d')
1332 easier to use non-ASCII characters in tests contained within a docstring.
1354 * In the :mod:`gc` module, the new :func:`get_count` function returns a 3-tuple
1409 The following example converts a maildir-format mailbox into an mbox-format
1461 3-tuple of *process-id*, *exit-status*, *resource-usage* as returned from the
1488 packages stored in ZIP-format archives. (Contributed by Phillip J. Eby.)
1490 * The pybench benchmark suite by Marc-André Lemburg is now included in the
1511 * Also deleted: the :file:`lib-old` directory, which includes ancient modules
1512 such as :mod:`dircmp` and :mod:`ni`, was removed. :file:`lib-old` wasn't on the
1517 :mod:`readline` module and therefore now works on non-Unix platforms. (Patch
1523 :attr:`rpc_paths` attribute that constrains XML-RPC operations to a limited set
1530 thanks to a patch from Philippe Biondi. Netlink sockets are a Linux-specific
1531 mechanism for communications between a user-space process and kernel code; an
1539 means you can put the data directly into an array or a memory-mapped file.
1551 objects. You can still use the module-level :func:`pack` and :func:`unpack`
1563 memory-mapped file.
1571 the ``sys.subversion`` variable, a 3-tuple of ``(interpreter-name, branch-name,
1572 revision-range)``. For example, at the time of writing my copy of 2.5 was
1618 UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')
1622 UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')
1626 UUID('16fd2706-8baf-433b-82eb-8c7fada847da')
1628 >>> # make a UUID using a SHA-1 hash of a namespace UUID and a name
1630 UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
1632 (Contributed by Ka-Ping Yee.)
1642 usable as a script with ``python -m webbrowser``, taking a URL as the argument;
1643 there are a number of switches to control the behaviour (:option:`!-n` for a new
1644 browser window, :option:`!-t` for a new tab). New module-level functions,
1654 for the XML-RPC date type. Supply ``use_datetime=True`` to the :func:`loads`
1676 .. _module-ctypes:
1679 ------------------
1683 libraries or DLLs. Long-time users may remember the :mod:`dl` module, which
1719 -1783957616
1741 distribution hand-coded extension modules because you can't rely on
1750 The pre-stdlib ctypes web page, with a tutorial, reference, and FAQ.
1757 .. _module-etree:
1760 -----------------------
1770 https://web.archive.org/web/20201124024954/http://effbot.org/zone/element-index.htm.
1779 string (assumed to contain a filename) or a file-like object and returns an
1784 tree = ET.parse('ex-1.xml')
1803 Each XML element supports some dictionary-like and some list-like access
1804 methods. Dictionary-like operations are used to access attribute values, and
1805 list-like operations are used to access child nodes.
1807 +-------------------------------+--------------------------------------------+
1811 +-------------------------------+--------------------------------------------+
1814 +-------------------------------+--------------------------------------------+
1816 +-------------------------------+--------------------------------------------+
1818 +-------------------------------+--------------------------------------------+
1820 +-------------------------------+--------------------------------------------+
1822 +-------------------------------+--------------------------------------------+
1824 +-------------------------------+--------------------------------------------+
1825 | ``elem.keys()`` | Returns list of attribute names. |
1826 +-------------------------------+--------------------------------------------+
1828 +-------------------------------+--------------------------------------------+
1830 +-------------------------------+--------------------------------------------+
1833 +-------------------------------+--------------------------------------------+
1835 +-------------------------------+--------------------------------------------+
1846 Like :func:`parse`, it can take either a string or a file-like object::
1848 # Encoding is US-ASCII
1851 # Encoding is UTF-8
1853 tree.write(f, encoding='utf-8')
1859 specify a different encoding such as UTF-8 that can handle any Unicode
1868 https://web.archive.org/web/20201124024954/http://effbot.org/zone/element-index.htm
1874 .. _module-hashlib:
1877 -------------------
1881 additional secure hashes (SHA-224, SHA-256, SHA-384, and SHA-512). When
1928 .. _module-sqlite:
1931 -------------------
1937 SQLite is a C library that provides a lightweight disk-based database that
1945 with the DB-API 2.0 specification described by :pep:`249`.
1972 values ('2006-01-05','BUY','RHAT',100,35.14)""")
1978 Instead, use the DB-API's parameter substitution. Put ``?`` as a placeholder
1983 # Never do this -- insecure!
1992 for t in (('2006-03-28', 'BUY', 'IBM', 1000, 45.00),
1993 ('2006-04-05', 'BUY', 'MSOFT', 1000, 72.00),
1994 ('2006-04-06', 'SELL', 'IBM', 500, 53.00),
2010 (u'2006-01-05', u'BUY', u'RHAT', 100, 35.140000000000001)
2011 (u'2006-03-28', u'BUY', u'IBM', 1000, 45.0)
2012 (u'2006-04-06', u'SELL', u'IBM', 500, 53.0)
2013 (u'2006-04-05', u'BUY', u'MSOFT', 1000, 72.0)
2031 :pep:`249` - Database API Specification 2.0
2032 PEP written by Marc-André Lemburg.
2037 .. _module-wsgiref:
2040 -------------------
2069 A central web site for WSGI-related resources.
2071 :pep:`333` - Python Web Server Gateway Interface v1.0
2077 .. _build-api:
2091 refcounting problems, often occurring in error-handling code. See
2096 :c:expr:`int`. See the earlier section :ref:`pep-353` for a discussion of this
2105 :func:`compile` built-in and specifying ``_ast.PyCF_ONLY_AST`` as the value of
2121 :file:`Include/Python-ast.h`. The :c:func:`PyParser_ASTFromString` and
2125 more information, read the source code, and then ask questions on python-dev.
2133 .. List of names taken from Jeremy's python-dev post at
2134 .. https://mail.python.org/pipermail/python-dev/2005-October/057500.html
2137 was applied. Python 2.4 allocated small objects in 256K-sized arenas, but never
2159 * The built-in set types now have an official C API. Call :c:func:`PySet_New`
2173 specified *type* and uses a fast-calling qualifier.
2207 Port-Specific Changes
2208 ---------------------
2211 :c:func:`dlopen` function instead of MacOS-specific functions.
2213 * MacOS X: an :option:`!--enable-universalsdk` switch was added to the
2215 able to run on both PowerPC and Intel processors. (Contributed by Ronald
2234 module contains string literals with 8-bit characters but doesn't have an
2239 object. Because of the :pep:`342` changes described in section :ref:`pep-342`,
2243 compare a Unicode string and an 8-bit string that can't be converted to Unicode
2247 * Library: the :mod:`csv` module is now stricter about multi-line quoted fields.
2262 have a :attr:`rpc_paths` attribute that constrains XML-RPC operations to a
2268 allow processing more data on 64-bit machines. Extension code may need to make
2269 the same change to avoid warnings and to support 64-bit machines. See the
2270 earlier section :ref:`pep-353` for a discussion of this change.
2286 Grosse-Kunstleve, Kent Johnson, Iain Lowe, Martin von Löwis, Fredrik Lundh, Andrew