summaryrefslogtreecommitdiff
path: root/Objects/typeobject.c
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2022-06-21 12:45:38 -0700
committerGitHub <noreply@github.com>2022-06-21 21:45:38 +0200
commit4e08fbcfdfa57ea94091aabdd09413708e3fb2bf (patch)
treec0f7fcee354ead27cbdbc69c19954555585e013c /Objects/typeobject.c
parentdd5cf84f245abf84405833320b8f25dbc43b24d2 (diff)
downloadcpython-git-4e08fbcfdfa57ea94091aabdd09413708e3fb2bf.tar.gz
gh-93021: Fix __text_signature__ for __get__ (GH-93023)
Because of the way wrap_descr_get is written, the second argument to __get__ methods implemented through the wrapper is always optional.
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r--Objects/typeobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 40df69e8b8..5ebff6084f 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -7184,7 +7184,7 @@ wrap_descr_get(PyObject *self, PyObject *args, void *wrapped)
obj = NULL;
if (type == Py_None)
type = NULL;
- if (type == NULL &&obj == NULL) {
+ if (type == NULL && obj == NULL) {
PyErr_SetString(PyExc_TypeError,
"__get__(None, None) is invalid");
return NULL;
@@ -8209,7 +8209,7 @@ static slotdef slotdefs[] = {
TPSLOT("__next__", tp_iternext, slot_tp_iternext, wrap_next,
"__next__($self, /)\n--\n\nImplement next(self)."),
TPSLOT("__get__", tp_descr_get, slot_tp_descr_get, wrap_descr_get,
- "__get__($self, instance, owner, /)\n--\n\nReturn an attribute of instance, which is of type owner."),
+ "__get__($self, instance, owner=None, /)\n--\n\nReturn an attribute of instance, which is of type owner."),
TPSLOT("__set__", tp_descr_set, slot_tp_descr_set, wrap_descr_set,
"__set__($self, instance, value, /)\n--\n\nSet an attribute of instance to value."),
TPSLOT("__delete__", tp_descr_set, slot_tp_descr_set,