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
3e57b52b
Commit
3e57b52b
authored
Aug 28, 2007
by
Thomas Wouters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix buglet in sliceobjects, they were not returning Py_NotImplemented when
compared against something other than sliceobjects.
parent
ed03b412
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
Lib/test/test_slice.py
Lib/test/test_slice.py
+3
-0
Objects/sliceobject.c
Objects/sliceobject.c
+5
-0
No files found.
Lib/test/test_slice.py
View file @
3e57b52b
...
...
@@ -26,6 +26,9 @@ class SliceTest(unittest.TestCase):
s3
=
slice
(
1
,
2
,
4
)
self
.
assertEqual
(
s1
,
s2
)
self
.
assertNotEqual
(
s1
,
s3
)
self
.
assertNotEqual
(
s1
,
None
)
self
.
assertNotEqual
(
s1
,
(
1
,
2
,
3
))
self
.
assertNotEqual
(
s1
,
""
)
class
Exc
(
Exception
):
pass
...
...
Objects/sliceobject.c
View file @
3e57b52b
...
...
@@ -286,6 +286,11 @@ slice_richcompare(PyObject *v, PyObject *w, int op)
PyObject
*
t2
;
PyObject
*
res
;
if
(
!
PySlice_Check
(
v
)
||
!
PySlice_Check
(
w
))
{
Py_INCREF
(
Py_NotImplemented
);
return
Py_NotImplemented
;
}
if
(
v
==
w
)
{
/* XXX Do we really need this shortcut?
There's a unit test for it, but is that fair? */
...
...
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