summaryrefslogtreecommitdiffstats
path: root/Modules/newmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-01-12 01:38:22 (GMT)
committerGuido van Rossum <guido@python.org>1996-01-12 01:38:22 (GMT)
commitb28911cdefeef7b263477108f6ebd1210d193e3a (patch)
treef1bcc8764fba0e42268132b80f579adfb84bc028 /Modules/newmodule.c
parentc0fd1c0b8313583cf81d413d5a55a61ffe9e11cf (diff)
downloadcpython-b28911cdefeef7b263477108f6ebd1210d193e3a.zip
cpython-b28911cdefeef7b263477108f6ebd1210d193e3a.tar.gz
cpython-b28911cdefeef7b263477108f6ebd1210d193e3a.tar.bz2
added new.classobj()
Diffstat (limited to 'Modules/newmodule.c')
-rw-r--r--Modules/newmodule.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/Modules/newmodule.c b/Modules/newmodule.c
index 98e5f72..afe3092 100644
--- a/Modules/newmodule.c
+++ b/Modules/newmodule.c
@@ -144,6 +144,24 @@ new_module(unused, args)
return newmoduleobject(name);
}
+static char new_class_doc[] =
+"Create a class object from (NAME, BASE_CLASSES, DICT).";
+
+static object *
+new_class(unused, args)
+ object* unused;
+ object* args;
+{
+ object * name;
+ object * classes;
+ object * dict;
+
+ if (!newgetargs(args, "SO!O!", &name, &Tupletype, &classes,
+ &Mappingtype, &dict))
+ return NULL;
+ return newclassobject(classes, dict, name);
+}
+
static struct methodlist new_methods[] = {
{"instancemethod", new_instancemethod, 1, new_im_doc},
#if 0
@@ -151,6 +169,7 @@ static struct methodlist new_methods[] = {
#endif
{"code", new_code, 1, new_code_doc},
{"module", new_module, 1, new_module_doc},
+ {"classobj", new_class, 1, new_class_doc},
{NULL, NULL} /* sentinel */
};