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
0558eb95
Commit
0558eb95
authored
Sep 23, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add param names for str.encode and decode
parent
bb6a2076
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
src/runtime/code.cpp
src/runtime/code.cpp
+3
-0
src/runtime/str.cpp
src/runtime/str.cpp
+8
-6
No files found.
src/runtime/code.cpp
View file @
0558eb95
...
...
@@ -129,6 +129,9 @@ BoxedCode::BoxedCode(int num_args, bool takes_varargs, bool takes_kwargs, int fi
num_args
(
num_args
),
times_interpreted
(
0
),
internal_callable
(
NULL
,
NULL
)
{
// If any param names are specified, make sure all of them are (to avoid common mistakes):
ASSERT
(
this
->
param_names
.
numNormalArgs
()
==
0
||
this
->
param_names
.
numNormalArgs
()
==
num_args
,
"%d %d"
,
this
->
param_names
.
numNormalArgs
(),
num_args
);
}
BoxedCode
::
BoxedCode
(
int
num_args
,
bool
takes_varargs
,
bool
takes_kwargs
,
const
char
*
name
,
const
char
*
doc
,
...
...
src/runtime/str.cpp
View file @
0558eb95
...
...
@@ -2741,12 +2741,14 @@ void setupStr() {
str_cls
->
giveAttr
(
"istitle"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
strIsTitle
,
BOXED_BOOL
,
1
,
"str.istitle"
)));
str_cls
->
giveAttr
(
"isupper"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
strIsUpper
,
BOXED_BOOL
,
1
,
"str.isupper"
)));
str_cls
->
giveAttr
(
"decode"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
strDecode
,
UNKNOWN
,
3
,
false
,
false
,
"str.decode"
),
{
0
,
0
}));
str_cls
->
giveAttr
(
"encode"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
strEncode
,
UNKNOWN
,
3
,
false
,
false
,
"str.encode"
),
{
0
,
0
}));
str_cls
->
giveAttr
(
"decode"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
strDecode
,
UNKNOWN
,
3
,
false
,
false
,
"str.decode"
,
""
,
ParamNames
({
""
,
"encoding"
,
"errors"
},
NULL
,
NULL
)),
{
0
,
0
}));
str_cls
->
giveAttr
(
"encode"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
strEncode
,
UNKNOWN
,
3
,
false
,
false
,
"str.encode"
,
""
,
ParamNames
({
""
,
"encoding"
,
"errors"
},
NULL
,
NULL
)),
{
0
,
0
}));
str_cls
->
giveAttr
(
"lower"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
strLower
,
STR
,
1
,
"str.lower"
)));
str_cls
->
giveAttr
(
"swapcase"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
strSwapcase
,
STR
,
1
,
"str.swapcase"
)));
...
...
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