Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
bebda731
Commit
bebda731
authored
Jun 04, 2015
by
Bob Fang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unifying behaviour -- step 1
unifying behaviour -- step 2 unifying behaviour -- step 3
parent
05fb51ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
src/runtime/classobj.cpp
src/runtime/classobj.cpp
+7
-9
No files found.
src/runtime/classobj.cpp
View file @
bebda731
...
...
@@ -712,24 +712,22 @@ static PyObject* instance_index(PyObject* self) noexcept {
return
res
;
}
Box
*
instanceEq
(
Box
*
_inst
,
Box
*
othe
r
)
{
Box
*
_instanceBinary
(
Box
*
_inst
,
Box
*
other
,
const
char
*
att
r
)
{
RELEASE_ASSERT
(
_inst
->
cls
==
instance_cls
,
""
);
BoxedInstance
*
inst
=
static_cast
<
BoxedInstance
*>
(
_inst
);
Box
*
func
=
_instanceGetattribute
(
inst
,
boxStrConstant
(
"__eq__"
),
false
);
Box
*
func
=
_instanceGetattribute
(
inst
,
boxStrConstant
(
attr
),
false
);
if
(
!
func
)
return
NotImplemented
;
return
runtimeCall
(
func
,
ArgPassSpec
(
1
),
other
,
NULL
,
NULL
,
NULL
,
NULL
);
}
Box
*
instance
Ne
(
Box
*
_inst
,
Box
*
other
)
{
RELEASE_ASSERT
(
_inst
->
cls
==
instance_cls
,
"
"
);
BoxedInstance
*
inst
=
static_cast
<
BoxedInstance
*>
(
_inst
);
Box
*
instance
Eq
(
Box
*
_inst
,
Box
*
other
)
{
return
_instanceBinary
(
_inst
,
other
,
"__eq__
"
);
}
Box
*
func
=
_instanceGetattribute
(
inst
,
boxStrConstant
(
"__ne__"
),
false
);
if
(
!
func
)
return
NotImplemented
;
return
runtimeCall
(
func
,
ArgPassSpec
(
1
),
other
,
NULL
,
NULL
,
NULL
,
NULL
);
Box
*
instanceNe
(
Box
*
_inst
,
Box
*
other
)
{
return
_instanceBinary
(
_inst
,
other
,
"__ne__"
);
}
Box
*
instanceCall
(
Box
*
_inst
,
Box
*
_args
,
Box
*
_kwargs
)
{
...
...
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