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
c5669633
Commit
c5669633
authored
Aug 18, 2015
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
let ~bin could take long as argument
parent
005e8477
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
src/runtime/long.cpp
src/runtime/long.cpp
+7
-0
No files found.
src/runtime/long.cpp
View file @
c5669633
...
...
@@ -744,6 +744,12 @@ Box* longStr(BoxedLong* v) {
return
_PyLong_Format
(
v
,
10
,
0
/* no L */
,
0
);
}
Box
*
longBin
(
BoxedLong
*
v
)
{
if
(
!
PyLong_Check
(
v
))
raiseExcHelper
(
TypeError
,
"descriptor '__bin__' requires a 'long' object but received a '%s'"
,
getTypeName
(
v
));
return
_PyLong_Format
(
v
,
2
,
0
/* no L */
,
0
);
}
Box
*
longHex
(
BoxedLong
*
v
)
{
if
(
!
PyLong_Check
(
v
))
raiseExcHelper
(
TypeError
,
"descriptor '__hex__' requires a 'long' object but received a '%s'"
,
getTypeName
(
v
));
...
...
@@ -1481,6 +1487,7 @@ void setupLong() {
long_cls
->
giveAttr
(
"__float__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
longFloat
,
UNKNOWN
,
1
)));
long_cls
->
giveAttr
(
"__repr__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
longRepr
,
STR
,
1
)));
long_cls
->
giveAttr
(
"__str__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
longStr
,
STR
,
1
)));
long_cls
->
giveAttr
(
"__bin__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
longBin
,
STR
,
1
)));
long_cls
->
giveAttr
(
"__hex__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
longHex
,
STR
,
1
)));
long_cls
->
giveAttr
(
"__oct__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
longOct
,
STR
,
1
)));
...
...
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