gh-117764: Fix and add signatures for many builtins (GH-117769)

This commit is contained in:
Serhiy Storchaka 2024-04-12 13:56:41 +03:00 committed by GitHub
parent 94e9c35cd0
commit 3a8c1ca7e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 45 additions and 30 deletions

View file

@ -6917,7 +6917,7 @@ static PyMethodDef object_methods[] = {
OBJECT___REDUCE_EX___METHODDEF
OBJECT___REDUCE___METHODDEF
OBJECT___GETSTATE___METHODDEF
{"__subclasshook__", object_subclasshook, METH_CLASS | METH_VARARGS,
{"__subclasshook__", object_subclasshook, METH_CLASS | METH_O,
object_subclasshook_doc},
{"__init_subclass__", object_init_subclass, METH_CLASS | METH_NOARGS,
object_init_subclass_doc},
@ -9893,7 +9893,8 @@ static pytype_slotdef slotdefs[] = {
TPSLOT(__getattribute__, tp_getattro, _Py_slot_tp_getattr_hook,
wrap_binaryfunc,
"__getattribute__($self, name, /)\n--\n\nReturn getattr(self, name)."),
TPSLOT(__getattr__, tp_getattro, _Py_slot_tp_getattr_hook, NULL, ""),
TPSLOT(__getattr__, tp_getattro, _Py_slot_tp_getattr_hook, NULL,
"__getattr__($self, name, /)\n--\n\nImplement getattr(self, name)."),
TPSLOT(__setattr__, tp_setattro, slot_tp_setattro, wrap_setattr,
"__setattr__($self, name, value, /)\n--\n\nImplement setattr(self, name, value)."),
TPSLOT(__delattr__, tp_setattro, slot_tp_setattro, wrap_delattr,
@ -9928,7 +9929,9 @@ static pytype_slotdef slotdefs[] = {
TPSLOT(__new__, tp_new, slot_tp_new, NULL,
"__new__(type, /, *args, **kwargs)\n--\n\n"
"Create and return new object. See help(type) for accurate signature."),
TPSLOT(__del__, tp_finalize, slot_tp_finalize, (wrapperfunc)wrap_del, ""),
TPSLOT(__del__, tp_finalize, slot_tp_finalize, (wrapperfunc)wrap_del,
"__del__($self, /)\n--\n\n"
"Called when the instance is about to be destroyed."),
BUFSLOT(__buffer__, bf_getbuffer, slot_bf_getbuffer, wrap_buffer,
"__buffer__($self, flags, /)\n--\n\n"