Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cae027b commit 14144fcCopy full SHA for 14144fc
1 file changed
Python/bltinmodule.c
@@ -637,6 +637,21 @@ builtin_setattr(self, args)
637
return None;
638
}
639
640
+static object *
641
+builtin_delattr(self, args)
642
+ object *self;
643
+ object *args;
644
+{
645
+ object *v;
646
+ object *name;
647
+ if (!getargs(args, "(OS)", &v, &name))
648
+ return NULL;
649
+ if (setattro(v, name, (object *)NULL) != 0)
650
651
+ INCREF(None);
652
+ return None;
653
+}
654
+
655
static object *
656
builtin_hash(self, args)
657
object *self;
@@ -1264,6 +1279,7 @@ static struct methodlist builtin_methods[] = {
1264
1279
{"cmp", builtin_cmp},
1265
1280
{"coerce", builtin_coerce},
1266
1281
{"compile", builtin_compile},
1282
+ {"delattr", builtin_delattr},
1267
1283
{"dir", builtin_dir},
1268
1284
{"divmod", builtin_divmod},
1269
1285
{"eval", builtin_eval},
0 commit comments