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
a0fd8884
Commit
a0fd8884
authored
Jan 20, 2009
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 4998: Decimal should not subclass or register with numbers.Real.
parent
7bf3a0e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
Lib/decimal.py
Lib/decimal.py
+5
-6
Lib/distutils/command/wininst-8.0.exe
Lib/distutils/command/wininst-8.0.exe
+0
-0
No files found.
Lib/decimal.py
View file @
a0fd8884
...
...
@@ -134,7 +134,6 @@ __all__ = [
'setcontext'
,
'getcontext'
,
'localcontext'
]
import
numbers
as
_numbers
import
copy
as
_copy
import
math
as
_math
...
...
@@ -501,7 +500,11 @@ def localcontext(ctx=None):
##### Decimal class #######################################################
class
Decimal
(
_numbers
.
Real
):
# Do not subclass Decimal from numbers.Real and do not register it as such
# (because Decimals are not interoperable with floats). See the notes in
# numbers.py for more detail.
class
Decimal
(
object
):
"""Floating point class for decimal arithmetic."""
__slots__
=
(
'_exp'
,
'_int'
,
'_sign'
,
'_is_special'
)
...
...
@@ -1757,14 +1760,10 @@ class Decimal(_numbers.Real):
>>> round(Decimal('Inf'))
Traceback (most recent call last):
...
...
...
OverflowError: cannot round an infinity
>>> round(Decimal('NaN'))
Traceback (most recent call last):
...
...
...
ValueError: cannot round a NaN
If a second argument n is supplied, self is rounded to n
...
...
Lib/distutils/command/wininst-8.0.exe
View file @
a0fd8884
This diff was suppressed by a .gitattributes entry.
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