Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 1843:8294bbd94535 legacy-trunk
Added delattr()
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 29 Aug 1994 12:53:40 +0000 |
| parents | 65cc727f1436 |
| children | 1822465a35b8 |
line wrap: on
line diff
--- a/Python/bltinmodule.c Mon Aug 29 12:53:11 1994 +0000 +++ b/Python/bltinmodule.c Mon Aug 29 12:53:40 1994 +0000 @@ -638,6 +638,21 @@ } static object * +builtin_delattr(self, args) + object *self; + object *args; +{ + object *v; + object *name; + if (!getargs(args, "(OS)", &v, &name)) + return NULL; + if (setattro(v, name, (object *)NULL) != 0) + return NULL; + INCREF(None); + return None; +} + +static object * builtin_hash(self, args) object *self; object *args; @@ -1264,6 +1279,7 @@ {"cmp", builtin_cmp}, {"coerce", builtin_coerce}, {"compile", builtin_compile}, + {"delattr", builtin_delattr}, {"dir", builtin_dir}, {"divmod", builtin_divmod}, {"eval", builtin_eval},
