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
762c1cb3
Commit
762c1cb3
authored
Aug 31, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test case to exercise fix for error propogation bug in dictionarys.
parent
65faf118
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
Lib/test/output/test_operations
Lib/test/output/test_operations
+4
-1
Lib/test/test_operations.py
Lib/test/test_operations.py
+24
-1
No files found.
Lib/test/output/test_operations
View file @
762c1cb3
test_operations
test_operations
3. Operations
3. Operations
XXX Not yet implemented
XXX Mostly not yet implemented
3.1 Dictionary lookups succeed even if __cmp__() raises an exception
raising error
No exception passed through.
Lib/test/test_operations.py
View file @
762c1cb3
...
@@ -2,4 +2,27 @@
...
@@ -2,4 +2,27 @@
print
'3. Operations'
print
'3. Operations'
print
'XXX Not yet implemented'
print
'XXX Mostly not yet implemented'
print
'3.1 Dictionary lookups succeed even if __cmp__() raises an exception'
# SourceForge bug #112558:
# http://sourceforge.net/bugs/?func=detailbug&bug_id=112558&group_id=5470
class
BadDictKey
:
def
__hash__
(
self
):
return
hash
(
self
.
__class__
)
def
__cmp__
(
self
,
other
):
if
isinstance
(
other
,
self
.
__class__
):
print
"raising error"
raise
RuntimeError
,
"gotcha"
return
other
d
=
{}
x1
=
BadDictKey
()
x2
=
BadDictKey
()
d
[
x1
]
=
1
d
[
x2
]
=
2
print
"No exception passed through."
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