From d221956f0e67f81a9381bab7eb4e22b78743d99c Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Thu, 17 Jan 2008 12:00:15 +0000 Subject: [PATCH] Revise 3141 section a bit; add some Windows items --- Doc/whatsnew/2.6.rst | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst index 48efabac97e..a47573c27a0 100644 --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -549,7 +549,7 @@ PEP 3141: A Type Hierarchy for Numbers ===================================================== In Python 3.0, several abstract base classes for numeric types, -inspired by Scheme's numeric tower (XXX add link), are being added. +inspired by Scheme's numeric tower, are being added. This change was backported to 2.6 as the :mod:`numbers` module. The most general ABC is :class:`Number`. It defines no operations at @@ -585,27 +585,17 @@ can be shifted left and right with ``<<`` and ``>>``, combined using bitwise operations such as ``&`` and ``|``, and can be used as array indexes and slice boundaries. -The PEP slightly redefines the existing built-ins :func:`math.floor`, -:func:`math.ceil`, :func:`round`, and adds a new one, :func:`trunc`. All of them -take a :class:`Real` value and return an :class:`Integral`. +In Python 3.0, the PEP slightly redefines the existing built-ins +:func:`math.floor`, :func:`math.ceil`, :func:`round`, and adds a new +one, :func:`trunc`, that's been backported to Python 2.6. +:func:`trunc` rounds toward zero, returning the closest +:class:`Integral` that's between the function's argument and zero. -* :func:`math.floor` returns the closest :class:`Integral` that's - smaller than the function's argument. Numeric types can define a - :meth:`__floor__` method to provide a custom implementation. +.. seealso:: -* :func:`math.ceil` returns the closest :class:`Integral` that's - greater than the function's argument. It can be provided by a - :meth:`__ceil__` method. - -* :func:`trunc` rounds toward zero, returning the closest - :class:`Integral` that's between the function's argument and zero. - It can be provided by a :meth:`__trunc` method. - -* :func:`round` takes a :class:`Real` and rounds it off, optionally to a - specified number of decimal places. It will call a :meth:`__round__` - method. Whether .5 should be rounded up, or down, or toward the - nearest even number, is left up to the type's implementation. + XXX link: Discusses Scheme's numeric tower. + The Rational Module -------------------------------------------------- @@ -1347,6 +1337,14 @@ Port-Specific Changes: Windows value, as does the :func:`getwche` function. The :func:`putwch` function takes a Unicode character and writes it to the console. +* :func:`os.path.expandvars` will now expand environment variables + in the form "%var%", and "~user" will be expanded into the + user's home directory path. (Contributed by Josiah Carlson.) + +* The :mod:`socket` module's socket objects now have an + :meth:`ioctl` method that provides a limited interface to the + :cfunc:`WSAIoctl` system interface. + * The :mod:`_winreg` module now has a function, :func:`ExpandEnvironmentStrings`, that expands environment variable references such as ``%NAME%``