diff Python/bltinmodule.c @ 1079:e4c6a0dd5c2b legacy-trunk

* bltinmodule.c: added built-in function cmp(a, b) * flmodule.c: added {do,check}_only_forms to fl's list of functions; and don't print a message when an unknown object is returned. * pythonrun.c: catch SIGHUP and SIGTERM to do essential cleanup. * Made jpegmodule.c smaller by using getargs() and mkvalue() consistently. * Increased parser stack size to 500 in parser.h. * Implemented custom allocation of stack frames to frameobject.c and added dynamic stack overflow checks (value stack only) to ceval.c. (There seems to be a bug left: sometimes stack traces don't make sense.)
author Guido van Rossum <guido@python.org>
date Sun, 18 Oct 1992 18:53:57 +0000
parents 2c0432fcc270
children d2af6bdcb6d0
line wrap: on
line diff
--- a/Python/bltinmodule.c	Sun Oct 18 17:09:59 1992 +0000
+++ b/Python/bltinmodule.c	Sun Oct 18 18:53:57 1992 +0000
@@ -78,6 +78,17 @@
 }
 
 static object *
+builtin_cmp(self, args)
+	object *self;
+	object *args;
+{
+	object *a, *b;
+	if (!getargs(args, "(OO)", &a, &b))
+		return NULL;
+	return newintobject((long)cmpobject(a, b));
+}
+
+static object *
 builtin_coerce(self, args)
 	object *self;
 	object *args;
@@ -608,6 +619,7 @@
 	{"abs",		builtin_abs},
 	{"apply",	builtin_apply},
 	{"chr",		builtin_chr},
+	{"cmp",		builtin_cmp},
 	{"coerce",	builtin_coerce},
 	{"dir",		builtin_dir},
 	{"divmod",	builtin_divmod},