Skip to content

Commit 5678904

Browse files
Add signatures for FrameLocalsProxyType methods.
1 parent 5a70fb0 commit 5678904

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

Lib/test/test_inspect/test_inspect.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6263,11 +6263,7 @@ def test_builtins_have_signatures(self):
62636263
methods_no_signature, methods_unsupported_signature)
62646264

62656265
def test_types_module_has_signatures(self):
6266-
methods_no_signature = {
6267-
'FrameLocalsProxyType': {'setdefault', 'pop', 'get'},
6268-
}
6269-
self._test_module_has_signatures(types,
6270-
methods_no_signature=methods_no_signature)
6266+
self._test_module_has_signatures(types)
62716267

62726268
def test_sys_module_has_signatures(self):
62736269
self._test_module_has_signatures(sys)

Objects/frameobject.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -902,13 +902,15 @@ static PyMethodDef framelocalsproxy_methods[] = {
902902
{"keys", framelocalsproxy_keys, METH_NOARGS, NULL},
903903
{"values", framelocalsproxy_values, METH_NOARGS, NULL},
904904
{"items", _PyCFunction_CAST(framelocalsproxy_items), METH_NOARGS, NULL},
905-
{"get", _PyCFunction_CAST(framelocalsproxy_get), METH_FASTCALL, NULL},
906-
{"pop", _PyCFunction_CAST(framelocalsproxy_pop), METH_FASTCALL, NULL},
905+
{"get", _PyCFunction_CAST(framelocalsproxy_get), METH_FASTCALL,
906+
PyDoc_STR("get($self, key, default=None, /)\n--\n\n")},
907+
{"pop", _PyCFunction_CAST(framelocalsproxy_pop), METH_FASTCALL,
908+
PyDoc_STR("pop($self, key, /)\n($self, key, default, /)\n--\n\n")},
907909
{
908910
"setdefault",
909911
_PyCFunction_CAST(framelocalsproxy_setdefault),
910912
METH_FASTCALL,
911-
NULL
913+
PyDoc_STR("setdefault($self, key, default=None, /)\n--\n\n")
912914
},
913915
{NULL, NULL} /* sentinel */
914916
};

0 commit comments

Comments
 (0)