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
3974e784
Commit
3974e784
authored
Jul 02, 2015
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print function name in lt, le, gt, ge test functions
parent
46267a9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
test/tests/oldstyle_classes.py
test/tests/oldstyle_classes.py
+5
-13
No files found.
test/tests/oldstyle_classes.py
View file @
3974e784
...
...
@@ -133,27 +133,17 @@ class LessEqualTest:
self
.
_a
=
a
def
__lt__
(
self
,
other
):
print
"lt"
return
self
.
_a
<
other
.
_a
def
__eq__
(
self
,
other
):
return
self
.
_a
==
other
.
_a
def
__ne__
(
self
,
other
):
return
self
.
_a
!=
other
.
_a
def
__le__
(
self
,
other
):
print
"le"
return
self
.
_a
<=
other
.
_a
ca
=
LessEqualTest
(
3
)
cb
=
LessEqualTest
(
2
)
cc
=
LessEqualTest
(
2
)
print
(
ca
==
cb
)
print
(
ca
==
cc
)
print
(
ca
!=
cb
)
print
(
ca
!=
cc
)
print
(
ca
<
cb
)
print
(
cb
<
ca
)
...
...
@@ -163,7 +153,7 @@ print(ca <= cc)
# CompareA only defines __lt__ and __le__ but appears on the right-hand-side
print
(
ca
>
cb
)
print
(
ca
>=
cb
)
print
(
c
a
>
cb
)
print
(
c
b
>
ca
)
print
(
cb
>
cc
)
class
GreatEqualTest
:
...
...
@@ -171,9 +161,11 @@ class GreatEqualTest:
self
.
_a
=
a
def
__gt__
(
self
,
other
):
print
"gt"
return
self
.
_a
>
other
.
_a
def
__ge__
(
self
,
other
):
print
"ge"
return
self
.
_a
>=
other
.
_a
cd
=
GreatEqualTest
(
4
)
...
...
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