Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2b5f4f74
Commit
2b5f4f74
authored
Jan 17, 2008
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revise 3141 section a bit; add some Windows items
parent
987a2d6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
19 deletions
+17
-19
Doc/whatsnew/2.6.rst
Doc/whatsnew/2.6.rst
+17
-19
No files found.
Doc/whatsnew/2.6.rst
View file @
2b5f4f74
...
...
@@ -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.
* :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.
.. seealso::
* :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%``
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment