diff options
author | Guido van Rossum <guido@python.org> | 1992-10-18 18:53:57 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-10-18 18:53:57 (GMT) |
commit | a9e7dc10816dcf5eda63d3ef00930ef9d55e0675 (patch) | |
tree | 5454bc7a52a71fe9639ec7f0cef856c413b25157 /Python/bltinmodule.c | |
parent | 2db91358def94cf8081f27b736988320d14eba39 (diff) | |
download | cpython-a9e7dc10816dcf5eda63d3ef00930ef9d55e0675.zip cpython-a9e7dc10816dcf5eda63d3ef00930ef9d55e0675.tar.gz cpython-a9e7dc10816dcf5eda63d3ef00930ef9d55e0675.tar.bz2 |
* 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.)
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 9ba07af..18fae5c 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -78,6 +78,17 @@ builtin_chr(self, args) } 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 @@ static struct methodlist builtin_methods[] = { {"abs", builtin_abs}, {"apply", builtin_apply}, {"chr", builtin_chr}, + {"cmp", builtin_cmp}, {"coerce", builtin_coerce}, {"dir", builtin_dir}, {"divmod", builtin_divmod}, |