Lines Matching +full:guile +full:- +full:2
1 .. _whats-new-in-2.6:
41 sufficient; the e-mail address isn't necessary.
61 :mod:`future_builtins` module and a :option:`!-3` switch to warn about
82 .. Compare with previous release in 2 - 3 sentences here.
86 .. Large, PEP-level features and changes should be described here.
97 Python 3.0 is a far-ranging redesign of Python that breaks
98 compatibility with the 2.x series. This means that existing Python
103 document in the appropriate place. Some of the 3.0-derived features
108 * The addition of :func:`functools.reduce` as a synonym for the built-in
111 Python 3.0 adds several new built-in functions and changes the
119 A new command-line switch, :option:`!-3`, enables warnings
131 3.0, and then explore the higher-numbered PEPS that propose
145 --------------------------------------------------
162 offers no-cost hosted instances to free-software projects; Roundup
163 is an open-source project that requires volunteers
197 -----------------------------------------------------------
211 L. Drake Jr., the long-time Python documentation editor, spent a lot
220 https://www.sphinx-doc.org/.
230 (`listed on the Sphinx web site <https://www.sphinx-doc.org/en/master/examples.html>`__)
238 `Sphinx <https://www.sphinx-doc.org/>`__
245 .. _pep-0343:
260 ``try...finally`` blocks to ensure that clean-up code is executed. In this
265 The ':keyword:`with`' statement is a control-flow structure whose basic
269 with-block
275 The object's :meth:`__enter__` is called before *with-block* is executed and
276 therefore can run set-up code. It also may return a value that is bound to the
280 After execution of the *with-block* is finished, the object's :meth:`__exit__`
282 clean-up code.
294 part-way through the block.
328 .. _new-26-context-managers:
331 ------------------------
339 A high-level explanation of the context management protocol is:
355 is re-raised: any false value re-raises the exception, and ``True`` will result
413 will be re-raised automatically. If you wished, you could be more explicit and
428 .. _new-module-contextlib:
431 ---------------------
488 :pep:`343` - The "with" statement
498 .. _pep-0366:
503 Python's :option:`-m` switch allows running a module as a script.
512 PEP 302-style importers can then set :attr:`__package__` as necessary.
513 The :mod:`runpy` module that implements the :option:`-m` switch now
519 .. _pep-0370:
521 PEP 370: Per-user ``site-packages`` Directory
525 includes a directory whose path ends in ``"site-packages"``. This
529 Python 2.6 introduces a convention for user-specific site directories.
535 Within this directory, there will be version-specific subdirectories,
536 such as :file:`lib/python2.6/site-packages` on Unix/Mac OS and
537 :file:`Python26/site-packages` on Windows.
542 Windows, the directory for application-specific data can be changed by
547 :option:`-s` option or setting the :envvar:`PYTHONNOUSERSITE`
552 :pep:`370` - Per-user ``site-packages`` Directory
558 .. _pep-0371:
625 higher-level interfaces. :class:`Pool` will create a fixed number of
651 The other high-level interface, the :class:`Manager` class, creates a
685 # Mark pool as closed -- no more tasks can be added.
708 :pep:`371` - Addition of the multiprocessing package
715 .. _pep-3101:
724 In 2.6, both 8-bit and Unicode strings have a ``.format()`` method that
753 >>> 'Content-type: {0[.mp4]}'.format(mimetypes.types_map)
754 'Content-type: video/mp4'
756 Note that when using dictionary-style notation such as ``[.mp4]``, you
791 < (default) Left-align
792 > Right-align
798 controls how the value is formatted. For example, floating-point numbers
810 ``b`` Binary. Outputs the number in base 2.
815 ``x`` Hex format. Outputs the number in base 16, using lower-case letters for
819 ``g`` General format. This prints the number as a fixed-point number, unless
842 >>> format(75.6564, '.2f')
851 :pep:`3101` - Advanced String Formatting
856 .. _pep-3105:
886 :pep:`3105` - Make print a function
891 .. _pep-3110:
893 PEP 3110: Exception-Handling Changes
937 :pep:`3110` - Catching Exceptions in Python 3000
942 .. _pep-3112:
948 denotes 8-bit literals differently, either as ``b'string'``
958 12-byte string representing the :func:`str` of the list.
961 object type such as ``isinstance(x, bytes)``. This will help the 2to3
962 converter, which can't tell whether 2.x code intends strings to
963 contain either characters or 8-bit bytes; you can now
979 At the C level, Python 3.0 will rename the existing 8-bit
980 string type, called :c:type:`PyStringObject` in Python 2.x,
992 >>> b = bytearray(u'\u21ef\u3244', 'utf-8')
998 >>> unicode(str(b), 'utf-8')
1021 :pep:`3112` - Bytes literals in Python 3000
1026 .. _pep-3116:
1031 Python's built-in file objects support a number of methods, but
1032 file-like objects don't necessarily support all of them. Objects that
1036 and text-handling features from the fundamental read and write
1064 that support write-only or read-only usage that have a :meth:`seek`
1070 over an in-memory buffer.
1091 and perhaps the C implementation will be backported to the 2.x releases.)
1096 forward-compatible with 3.0, and to save developers the effort of writing
1101 :pep:`3116` - New I/O
1108 .. _pep-3118:
1113 The buffer protocol is a C-level API that lets Python types
1115 memory-mapped file can be viewed as a buffer of characters, for
1117 treat memory-mapped files as a string of characters to be searched.
1119 The primary users of the buffer protocol are numeric-processing
1136 .. XXX PyObject_GetBuffer not documented in c-api
1143 * :const:`PyBUF_LOCK` requests a read-only or exclusive lock on the memory.
1146 requests a C-contiguous (last dimension varies the fastest) or
1147 Fortran-contiguous (first dimension varies the fastest) array layout.
1154 :pep:`3118` - Revising the buffer protocol
1161 .. _pep-3119:
1166 Some object-oriented languages such as Java support interfaces,
1177 dictionary-style access. The phrase "dictionary-style" is vague, however.
1179 Does it imply that setting items with ``obj[2] = value`` works?
1216 to declare that some third-party class implements an ABC.
1237 above example. Python has a strong tradition of duck-typing, where
1238 explicit type-checking is never done and code simply calls methods on
1301 :pep:`3119` - Introducing Abstract Base Classes
1308 .. _pep-3127:
1313 Python 3.0 changes the syntax for octal (base-8) integer literals,
1315 support for binary (base-2) integer literals, signalled by a "0b" or
1321 >>> 0o21, 2*8 + 1
1338 and "0b" prefixes when base-8 or base-2 are requested, or when the
1344 >>> int('1101', 2)
1346 >>> int('0b1101', 2)
1354 :pep:`3127` - Integer Literal Support and Syntax
1360 .. _pep-3129:
1382 :pep:`3129` - Class Decorators
1387 .. _pep-3141:
1403 real and imaginary parts and obtain a number's conjugate. Python's built-in
1413 converted to floats. Python 2.6 adds a simple rational-number class,
1431 :pep:`3141` - A Type Hierarchy for Numbers
1434 … tower <https://www.gnu.org/software/guile/manual/html_node/Numerical-Tower.html#Numerical-Tower>`…
1436 …onservatory.scheme.org/schemers/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.2>`__ from t…
1440 --------------------------------------------------
1443 module provides a rational-number class. Rational numbers store their
1445 exactly represent numbers such as ``2/3`` that floating-point numbers
1452 >>> a = Fraction(2, 3)
1453 >>> b = Fraction(2, 5)
1461 For converting floating-point numbers to rationals,
1464 floating-point value::
1467 (5, 2)
1473 Note that values that can only be approximated by floating-point
1475 approximated; the fraction attempts to match the floating-point value
1525 >>> f(1,2,3, *(4,5,6), keyword=13)
1526 (1, 2, 3, 4, 5, 6) {'keyword': 13}
1540 >>> t = (0,1,2,3,4,0,1,2)
1544 2
1548 * The built-in types now have improved support for extended slicing syntax,
1576 return self._x * 2
1580 self._x = value / 2
1582 * Several methods of the built-in set types now accept multiple iterables:
1592 set(['2'])
1598 * Many floating-point features were added. The :func:`float` function
1600 IEEE 754 Not A Number value, and ``+inf`` and ``-inf`` into
1605 :func:`isnan`, return true if their floating-point argument is
1608 Conversion functions were added to convert floating-point numbers
1623 '0x1.5555555555555p-2'
1626 on systems that support signed zeros (-0 and +0), the
1656 * The :func:`compile` built-in function now accepts keyword arguments
1662 will now round-trip values. For example, ``complex('(3+4j)')``
1671 * The built-in :func:`dir` function now checks for a :meth:`__dir__`
1676 methods can use this to advertise pseudo-attributes they will honor.
1693 -------------
1730 * Some of the standard built-in types now set a bit in their type
1744 free lists when garbage-collecting the highest generation of objects.
1749 .. _new-26-interpreter:
1752 -------------------------------
1754 Two command-line options have been reserved for use by other Python
1755 implementations. The :option:`-J` switch has been reserved for use by
1756 Jython for Jython-specific options, such as switches that are passed to
1757 the underlying JVM. :option:`-X` has been reserved for options
1763 files by supplying the :option:`-B` switch to the Python interpreter,
1774 The *encoding* part specifies the encoding's name, e.g. ``utf-8`` or
1775 ``latin-1``; the optional *errorhandler* part specifies
1811 "/cgi-bin/add.py?category=1". (Contributed by Alexandre Fiori and
1850 special values and floating-point exceptions in a manner consistent
1867 >>> print var[2], var.type # Equivalent
1894 >>> dq.append(1); dq.append(2); dq.append(3)
1896 deque([1, 2, 3], maxlen=3)
1899 deque([2, 3, 4], maxlen=3)
1925 object, zero-padded on
1959 * The :func:`reduce` built-in function is also available in the
1962 currently there are no plans to drop the builtin in the 2.x series.
1980 >>> list(heapq.merge([1, 3, 5, 9], [2, 8, 16]))
1981 [1, 2, 3, 5, 8, 9, 16]
1988 :mod:`heapq` is now implemented to only use less-than comparison,
1989 instead of the less-than-or-equal comparison it previously used.
2015 >>> tuple(itertools.izip_longest([1,2,3], [1,2,3,4,5]))
2016 ((1, 1), (2, 2), (3, 3), (None, 4), (None, 5))
2022 >>> list(itertools.product([1,2,3], [4,5,6]))
2024 (2, 4), (2, 5), (2, 6),
2029 repeated *N* times. With a single iterable argument, *N*-tuples
2032 >>> list(itertools.product([1,2], repeat=3))
2033 [(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2),
2034 (2, 1, 1), (2, 1, 2), (2, 2, 1), (2, 2, 2)]
2036 With two iterables, *2N*-tuples are returned. ::
2038 >>> list(itertools.product([1,2], [3,4], repeat=2))
2039 [(1, 3, 1, 3), (1, 3, 1, 4), (1, 3, 2, 3), (1, 3, 2, 4),
2040 (1, 4, 1, 3), (1, 4, 1, 4), (1, 4, 2, 3), (1, 4, 2, 4),
2041 (2, 3, 1, 3), (2, 3, 1, 4), (2, 3, 2, 3), (2, 3, 2, 4),
2042 (2, 4, 1, 3), (2, 4, 1, 4), (2, 4, 2, 3), (2, 4, 2, 4)]
2044 ``combinations(iterable, r)`` returns sub-sequences of length *r* from
2047 >>> list(itertools.combinations('123', 2))
2048 [('1', '2'), ('1', '3'), ('2', '3')]
2050 [('1', '2', '3')]
2052 [('1', '2', '3'), ('1', '2', '4'),
2053 ('1', '3', '4'), ('2', '3', '4')]
2059 >>> list(itertools.permutations([1,2,3,4], 2))
2060 [(1, 2), (1, 3), (1, 4),
2061 (2, 1), (2, 3), (2, 4),
2062 (3, 1), (3, 2), (3, 4),
2063 (4, 1), (4, 2), (4, 3)]
2072 >>> list(itertools.chain.from_iterable([[1,2,3], [4,5,6]]))
2073 [1, 2, 3, 4, 5, 6]
2096 *y*. For example, ``math.copysign(1, -0.0)`` returns -1.0.
2116 `PEP 3141's type hierarchy for numbers <#pep-3141>`__.
2120 floating-point exceptions and IEEE 754 special values.
2123 standard about 754's special values. For example, ``sqrt(-1.)``
2127 'divide-by-zero' or 'invalid', Python will raise :exc:`ValueError`.
2196 This produces better results when operating on Unix's dot-files.
2213 and can optionally take new command-line arguments for the program.
2233 +-- SystemExit
2234 +-- KeyboardInterrupt
2235 +-- GeneratorExit
2236 +-- Exception
2237 +-- StopIteration
2238 +-- StandardError
2256 now be pickled on a 32-bit system and unpickled on a 64-bit
2271 time-consuming searches can now be interrupted.
2275 for a tiny regex-specific virtual machine. Untrusted code
2286 have a read-only :attr:`queue` attribute that returns the
2306 takes an arbitrary number of glob-style patterns and returns a
2324 file descriptor. There's also a C-level function,
2345 wall-clock time, consumed process time, or combined process+system
2358 e-mail between agents that don't manage a mail queue. (LMTP
2367 a high-performance non-IP-based protocol designed for use in clustered
2368 environments. TIPC addresses are 4- or 5-tuples.
2389 has been updated from version 2.3.2 in Python 2.5 to
2405 about the platform's floating-point support. Attributes of this
2414 variable is initially set on start-up by supplying the :option:`-B`
2422 Information about the command-line arguments supplied to the Python
2427 These attributes are all read-only.
2431 the amount of memory used by the object, measured in bytes. Built-in
2432 objects return correct results; third-party extensions may not,
2441 * The :mod:`tarfile` module now supports POSIX.1-2001 (pax) tarfiles in
2442 addition to the POSIX.1-1988 (ustar) and GNU tar formats that were
2453 ``'utf-8'`` is a special value that replaces bad characters with
2454 their UTF-8 representation. (Character conversions occur because the
2455 PAX format supports Unicode filenames, defaulting to UTF-8 encoding.)
2479 an on-disk temporary file. (Contributed by Dustin J. Mitchell.)
2539 underscores instead of camel-case; for example, the
2544 be removed in any 2.x version.
2605 line of source code. (Added as part of :issue:`1631171`, which re-implemented
2612 * The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer`
2623 as HTTP headers "X-Exception" and "X-Traceback". This feature is
2636 and 64-bit integers represented by using ``<i8>`` in XML-RPC responses
2644 z = zipfile.ZipFile('python-251.zip')
2667 ----------------------
2685 d[i + i] = ord(i) - ord('a') + 1
2731 >>> literal = '("a", "b", {2:4, 3:8, 1:2})'
2733 ('a', 'b', {1: 2, 2: 4, 3: 8})
2747 --------------------------------------
2749 Python 3.0 makes many changes to the repertoire of built-in
2751 2.x series because they would break compatibility.
2753 of these built-in functions that can be imported when writing
2754 3.0-compatible code.
2764 return iterators, unlike the 2.x builtins which return lists.
2775 --------------------------------------------------------------------
2782 :mod:`json` comes with support for decoding and encoding most built-in Python
2794 more types. Pretty-printing of the JSON strings is also supported.
2802 The :mod:`plistlib` module: A Property-List Parser
2803 --------------------------------------------------
2807 and dictionaries) by serializing them into an XML-based format.
2808 It resembles the XML-RPC serialization of data types.
2811 has nothing Mac-specific about it and the Python implementation works
2836 # read/writePlist accepts file-like objects as well as paths.
2842 --------------------------------------------------
2872 and then call the module-level methods :meth:`set_errno` and
2878 and then call the module-level methods :meth:`set_last_error`
2888 --------------------------------------------------
2921 * (3.0-warning mode) Python 3.0 will feature a reorganized standard
2923 Python 2.6 running in 3.0-warning mode will warn about these modules
2969 use the built-in :class:`set` and :class:`frozenset` types.
2993 * On Mac OS X, Python 2.6 can be compiled as a 4-way universal build.
2995 can take a :option:`!--with-universal-archs=[32-bit|64-bit|all]`
2996 switch, controlling whether the binaries are built for 32-bit
2997 architectures (x86, PowerPC), 64-bit (x86-64 and PPC-64), or both.
3006 `the PEP 3118 section <#pep-3118-revised-buffer-protocol>`__,
3010 * Python's use of the C stdio library is now thread-safe, or at least
3011 as thread-safe as the underlying library is. A long-standing potential
3020 immediately after the GIL is re-acquired.
3032 floating-point support. :c:func:`PyFloat_GetMax` returns
3049 * Python's C API now includes two functions for case-insensitive string
3066 The mixed-case macros are still available
3075 internal free lists of objects that can be re-used. The data
3088 Another new target, "make profile-opt", compiles a Python binary
3089 using GCC's profile-guided optimization. It compiles Python with
3096 Port-Specific Changes: Windows
3097 -----------------------------------
3135 registry reflection for 32-bit processes running on 64-bit systems.
3145 Port-Specific Changes: Mac OS X
3146 -----------------------------------
3150 :option:`!--with-framework-name=` option to the
3199 Port-Specific Changes: IRIX
3200 -----------------------------------
3202 A number of old IRIX-specific modules were deprecated and will
3264 the built-in :func:`__import__` function, it would actually import
3289 * (3.0-warning mode) The :class:`Exception` class now warns
3293 * (3.0-warning mode) inequality comparisons between two dictionaries