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
2a800180
Commit
2a800180
authored
Jul 30, 2015
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test for new added function to oldstyle class
parent
5b9e5151
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
test/tests/oldstyle_classes.py
test/tests/oldstyle_classes.py
+69
-0
No files found.
test/tests/oldstyle_classes.py
View file @
2a800180
...
...
@@ -63,6 +63,61 @@ class E():
print
"ne"
return
self
.
n
!=
other
.
n
def
__neg__
(
self
):
print
"neg"
return
-
self
.
n
def
__pos__
(
self
):
print
"pos"
return
+
self
.
n
def
__abs__
(
self
):
print
"abs"
return
abs
(
self
.
n
)
def
__invert__
(
self
):
print
"invert"
return
~
self
.
n
def
__complex__
(
self
):
print
"complex"
return
complex
(
self
.
n
)
def
__int__
(
self
):
print
"int"
return
int
(
self
.
n
)
def
__long__
(
self
):
print
"long"
return
long
(
self
.
n
)
def
__float__
(
self
):
print
"float"
return
float
(
self
.
n
)
def
__oct__
(
self
):
print
"oct"
return
oct
(
self
.
n
)
def
__hex__
(
self
):
print
"hex"
return
hex
(
self
.
n
)
def
__coerce__
(
self
,
other
):
print
"coerce"
return
(
int
(
self
.
n
),
other
)
def
__enter__
(
self
):
print
'enter'
return
'something'
def
__exit__
(
self
,
type
,
value
,
traceback
):
print
'exit'
return
False
def
__reversed__
(
self
):
print
"reversed"
e
=
E
(
1
)
print
e
print
e
.
n
...
...
@@ -73,6 +128,20 @@ print len(e)
print
e
()(
"test"
)
print
e
==
E
(
1
)
print
e
!=
E
(
1
)
print
-
e
print
+
e
print
abs
(
e
)
print
~
e
print
int
(
e
)
print
long
(
e
)
print
float
(
e
)
print
oct
(
e
)
print
hex
(
e
)
print
coerce
(
e
,
10
)
reversed
(
e
)
with
e
as
s
:
print
s
def
str2
():
return
"str2"
...
...
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