Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Kirill Smelkov
cpython
Commits
896fc7ed
Commit
896fc7ed
authored
Sep 30, 1995
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-enable new.code(...) with new args
parent
64b24fb0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
Modules/newmodule.c
Modules/newmodule.c
+18
-3
No files found.
Modules/newmodule.c
View file @
896fc7ed
...
...
@@ -91,28 +91,43 @@ new_function(unused, args)
return (object *)newfunc;
}
#endif
static
char
new_code_doc
[]
=
"Create a code object from (
CODESTRING, CONSTANTS,
NAMES, FILENAME, NAME).";
"Create a code object from (
ARGCOUNT, NLOCALS, FLAGS, CODESTRING, CONSTANTS, NAMES, VAR
NAMES, FILENAME, NAME)."
;
static
object
*
new_code
(
unused
,
args
)
object
*
unused
;
object
*
args
;
{
int
argcount
;
int
nlocals
;
int
flags
;
object
*
code
;
object
*
consts
;
object
*
names
;
object
*
varnames
;
object
*
filename
;
object
*
name
;
#if 0
if (!newgetargs(args, "SO!O!SS",
&code, &Tupletype, &consts, &Tupletype, &names,
&filename, &name))
return NULL;
return (object *)newcodeobject(code, consts, names, filename, name);
}
#else
if
(
!
newgetargs
(
args
,
"iiiSO!O!O!SS"
,
&
argcount
,
&
nlocals
,
&
flags
,
/* These are new */
&
code
,
&
Tupletype
,
&
consts
,
&
Tupletype
,
&
names
,
&
Tupletype
,
&
varnames
,
/* These are new */
&
filename
,
&
name
))
return
NULL
;
return
(
object
*
)
newcodeobject
(
argcount
,
nlocals
,
flags
,
code
,
consts
,
names
,
varnames
,
filename
,
name
);
#endif
}
static
char
new_module_doc
[]
=
"Create a module object from (NAME)."
;
...
...
@@ -133,8 +148,8 @@ static struct methodlist new_methods[] = {
{
"instancemethod"
,
new_instancemethod
,
1
,
new_im_doc
},
#if 0
{"function", new_function, 1, new_function_doc},
{"code", new_code, 1, new_code_doc},
#endif
{
"code"
,
new_code
,
1
,
new_code_doc
},
{
"module"
,
new_module
,
1
,
new_module_doc
},
{
NULL
,
NULL
}
/* sentinel */
};
...
...
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