pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/3a8c1ca7e7ce181ddb29c9393171d5c508ce89c8

60c69660fa.css" /> gh-117764: Fix and add signatures for many builtins (GH-117769) · python/cpython@3a8c1ca · GitHub
Skip to content

Commit 3a8c1ca

Browse files
gh-117764: Fix and add signatures for many builtins (GH-117769)
1 parent 94e9c35 commit 3a8c1ca

11 files changed

Lines changed: 45 additions & 30 deletions

File tree

Objects/clinic/descrobject.c.h

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Objects/descrobject.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,8 @@ mappingproxy_reversed(PyObject *self, PyObject *Py_UNUSED(ignored))
11651165

11661166
static PyMethodDef mappingproxy_methods[] = {
11671167
{"get", _PyCFunction_CAST(mappingproxy_get), METH_FASTCALL,
1168-
PyDoc_STR("D.get(k[,d]) -> D[k] if k in D, else d."
1169-
" d defaults to None.")},
1168+
PyDoc_STR("get($self, key, default=None, /)\n--\n\n"
1169+
"Return the value for key if key is in the mapping, else default.")},
11701170
{"keys", mappingproxy_keys, METH_NOARGS,
11711171
PyDoc_STR("D.keys() -> a set-like object providing a view on D's keys")},
11721172
{"values", mappingproxy_values, METH_NOARGS,
@@ -1254,11 +1254,12 @@ mappingproxy.__new__ as mappingproxy_new
12541254
12551255
mapping: object
12561256
1257+
Read-only proxy of a mapping.
12571258
[clinic start generated code]*/
12581259

12591260
static PyObject *
12601261
mappingproxy_new_impl(PyTypeObject *type, PyObject *mapping)
1261-
/*[clinic end generated code: output=65f27f02d5b68fa7 input=d2d620d4f598d4f8]*/
1262+
/*[clinic end generated code: output=65f27f02d5b68fa7 input=c156df096ef7590c]*/
12621263
{
12631264
mappingproxyobject *mappingproxy;
12641265

@@ -2024,7 +2025,7 @@ PyTypeObject PyDictProxy_Type = {
20242025
0, /* tp_as_buffer */
20252026
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
20262027
Py_TPFLAGS_MAPPING, /* tp_flags */
2027-
0, /* tp_doc */
2028+
mappingproxy_new__doc__, /* tp_doc */
20282029
mappingproxy_traverse, /* tp_traverse */
20292030
0, /* tp_clear */
20302031
mappingproxy_richcompare, /* tp_richcompare */

Objects/genericaliasobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ _Py_subs_parameters(PyObject *self, PyObject *args, PyObject *parameters, PyObje
537537
}
538538

539539
PyDoc_STRVAR(genericalias__doc__,
540+
"GenericAlias(origen, args, /)\n"
541+
"--\n\n"
540542
"Represent a PEP 585 generic type\n"
541543
"\n"
542544
"E.g. for t = list[int], t.__origen__ is list and t.__args__ is (int,).");

Objects/memoryobject.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3255,6 +3255,9 @@ PyDoc_STRVAR(memory_f_contiguous_doc,
32553255
"A bool indicating whether the memory is Fortran contiguous.");
32563256
PyDoc_STRVAR(memory_contiguous_doc,
32573257
"A bool indicating whether the memory is contiguous.");
3258+
PyDoc_STRVAR(memory_exit_doc,
3259+
"__exit__($self, /, *exc_info)\n--\n\n"
3260+
"Release the underlying buffer exposed by the memoryview object.");
32583261

32593262

32603263
static PyGetSetDef memory_getsetlist[] = {
@@ -3283,7 +3286,7 @@ static PyMethodDef memory_methods[] = {
32833286
MEMORYVIEW_TOREADONLY_METHODDEF
32843287
MEMORYVIEW__FROM_FLAGS_METHODDEF
32853288
{"__enter__", memory_enter, METH_NOARGS, NULL},
3286-
{"__exit__", memory_exit, METH_VARARGS, NULL},
3289+
{"__exit__", memory_exit, METH_VARARGS, memory_exit_doc},
32873290
{NULL, NULL}
32883291
};
32893292

Objects/namespaceobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ static PyMethodDef namespace_methods[] = {
227227

228228

229229
PyDoc_STRVAR(namespace_doc,
230-
"A simple attribute-based namespace.\n\
231-
\n\
232-
SimpleNamespace(**kwargs)");
230+
"SimpleNamespace(**kwargs)\n\
231+
--\n\n\
232+
A simple attribute-based namespace.");
233233

234234
PyTypeObject _PyNamespace_Type = {
235235
PyVarObject_HEAD_INIT(&PyType_Type, 0)

Objects/rangeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ PyDoc_STRVAR(index_doc,
751751

752752
static PyMethodDef range_methods[] = {
753753
{"__reversed__", range_reverse, METH_NOARGS, reverse_doc},
754-
{"__reduce__", (PyCFunction)range_reduce, METH_VARARGS},
754+
{"__reduce__", (PyCFunction)range_reduce, METH_NOARGS},
755755
{"count", (PyCFunction)range_count, METH_O, count_doc},
756756
{"index", (PyCFunction)range_index, METH_O, index_doc},
757757
{NULL, NULL} /* sentinel */

Objects/typeobject.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6917,7 +6917,7 @@ static PyMethodDef object_methods[] = {
69176917
OBJECT___REDUCE_EX___METHODDEF
69186918
OBJECT___REDUCE___METHODDEF
69196919
OBJECT___GETSTATE___METHODDEF
6920-
{"__subclasshook__", object_subclasshook, METH_CLASS | METH_VARARGS,
6920+
{"__subclasshook__", object_subclasshook, METH_CLASS | METH_O,
69216921
object_subclasshook_doc},
69226922
{"__init_subclass__", object_init_subclass, METH_CLASS | METH_NOARGS,
69236923
object_init_subclass_doc},
@@ -9893,7 +9893,8 @@ static pytype_slotdef slotdefs[] = {
98939893
TPSLOT(__getattribute__, tp_getattro, _Py_slot_tp_getattr_hook,
98949894
wrap_binaryfunc,
98959895
"__getattribute__($self, name, /)\n--\n\nReturn getattr(self, name)."),
9896-
TPSLOT(__getattr__, tp_getattro, _Py_slot_tp_getattr_hook, NULL, ""),
9896+
TPSLOT(__getattr__, tp_getattro, _Py_slot_tp_getattr_hook, NULL,
9897+
"__getattr__($self, name, /)\n--\n\nImplement getattr(self, name)."),
98979898
TPSLOT(__setattr__, tp_setattro, slot_tp_setattro, wrap_setattr,
98989899
"__setattr__($self, name, value, /)\n--\n\nImplement setattr(self, name, value)."),
98999900
TPSLOT(__delattr__, tp_setattro, slot_tp_setattro, wrap_delattr,
@@ -9928,7 +9929,9 @@ static pytype_slotdef slotdefs[] = {
99289929
TPSLOT(__new__, tp_new, slot_tp_new, NULL,
99299930
"__new__(type, /, *args, **kwargs)\n--\n\n"
99309931
"Create and return new object. See help(type) for accurate signature."),
9931-
TPSLOT(__del__, tp_finalize, slot_tp_finalize, (wrapperfunc)wrap_del, ""),
9932+
TPSLOT(__del__, tp_finalize, slot_tp_finalize, (wrapperfunc)wrap_del,
9933+
"__del__($self, /)\n--\n\n"
9934+
"Called when the instance is about to be destroyed."),
99329935

99339936
BUFSLOT(__buffer__, bf_getbuffer, slot_bf_getbuffer, wrap_buffer,
99349937
"__buffer__($self, flags, /)\n--\n\n"

Python/bltinmodule.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ builtin_breakpoint(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb
475475
}
476476

477477
PyDoc_STRVAR(breakpoint_doc,
478-
"breakpoint(*args, **kws)\n\
478+
"breakpoint($module, /, *args, **kws)\n\
479479
--\n\
480480
\n\
481481
Call sys.breakpointhook(*args, **kws). sys.breakpointhook() must accept\n\
@@ -1703,16 +1703,16 @@ anext as builtin_anext
17031703
default: object = NULL
17041704
/
17051705
1706-
async anext(aiterator[, default])
1706+
Return the next item from the async iterator.
17071707
1708-
Return the next item from the async iterator. If default is given and the async
1709-
iterator is exhausted, it is returned instead of raising StopAsyncIteration.
1708+
If default is given and the async iterator is exhausted,
1709+
it is returned instead of raising StopAsyncIteration.
17101710
[clinic start generated code]*/
17111711

17121712
static PyObject *
17131713
builtin_anext_impl(PyObject *module, PyObject *aiterator,
17141714
PyObject *default_value)
1715-
/*[clinic end generated code: output=f02c060c163a81fa input=8f63f4f78590bb4c]*/
1715+
/*[clinic end generated code: output=f02c060c163a81fa input=2900e4a370d39550]*/
17161716
{
17171717
PyTypeObject *t;
17181718
PyObject *awaitable;

Python/clinic/bltinmodule.c.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/clinic/traceback.c.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy