mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.10] gh-91118: Fix docstrings that do not honor --without-doc-strings (GH-31769) (#91662)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit a573cb2fec
)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
This commit is contained in:
parent
a885f10325
commit
e7e8a9fa4f
17 changed files with 81 additions and 65 deletions
|
@ -349,6 +349,11 @@ _Py_subs_parameters(PyObject *self, PyObject *args, PyObject *parameters, PyObje
|
|||
return newargs;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(genericalias__doc__,
|
||||
"Represent a PEP 585 generic type\n"
|
||||
"\n"
|
||||
"E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).");
|
||||
|
||||
static PyObject *
|
||||
ga_getitem(PyObject *self, PyObject *item)
|
||||
{
|
||||
|
@ -628,14 +633,11 @@ static PyNumberMethods ga_as_number = {
|
|||
|
||||
// TODO:
|
||||
// - argument clinic?
|
||||
// - __doc__?
|
||||
// - cache?
|
||||
PyTypeObject Py_GenericAliasType = {
|
||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||
.tp_name = "types.GenericAlias",
|
||||
.tp_doc = "Represent a PEP 585 generic type\n"
|
||||
"\n"
|
||||
"E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).",
|
||||
.tp_doc = genericalias__doc__,
|
||||
.tp_basicsize = sizeof(gaobject),
|
||||
.tp_dealloc = ga_dealloc,
|
||||
.tp_repr = ga_repr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue