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
70b62b12
Commit
70b62b12
authored
Nov 21, 2010
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert r86517
parent
4d09da71
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
5 deletions
+2
-5
Lib/decimal.py
Lib/decimal.py
+1
-1
Lib/test/test_decimal.py
Lib/test/test_decimal.py
+1
-1
Misc/NEWS
Misc/NEWS
+0
-3
No files found.
Lib/decimal.py
View file @
70b62b12
...
...
@@ -943,7 +943,7 @@ class Decimal(object):
# in the documentation. (See library docs, 'Built-in Types').
if
self
.
_is_special
:
if
self
.
is_snan
():
raise
Valu
eError
(
'Cannot hash a signaling NaN value.'
)
raise
Typ
eError
(
'Cannot hash a signaling NaN value.'
)
elif
self
.
is_nan
():
return
_PyHASH_NAN
else
:
...
...
Lib/test/test_decimal.py
View file @
70b62b12
...
...
@@ -1346,7 +1346,7 @@ class DecimalUsabilityTest(unittest.TestCase):
#the same hash that to an int
self
.
assertEqual
(
hashit
(
Decimal
(
23
)),
hashit
(
23
))
self
.
assertRaises
(
Valu
eError
,
hash
,
Decimal
(
'sNaN'
))
self
.
assertRaises
(
Typ
eError
,
hash
,
Decimal
(
'sNaN'
))
self
.
assertTrue
(
hashit
(
Decimal
(
'Inf'
)))
self
.
assertTrue
(
hashit
(
Decimal
(
'-Inf'
)))
...
...
Misc/NEWS
View file @
70b62b12
...
...
@@ -172,9 +172,6 @@ Library
- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
- Issue #10356: hash(Decimal("sNaN")) now raises ValueError instead of
TypeError.
- Issue #10356: Decimal.__hash__(-1) should return -2.
- Issue #1553375: logging: Added stack_info kwarg to display stack information.
...
...
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