Skip to content

Commit 5923263

Browse files
committed
Add a signature for FrameLocalsProxy()
1 parent fb710eb commit 5923263

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Lib/test/test_inspect/test_inspect.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5788,11 +5788,9 @@ def test_types_module_has_signatures(self):
57885788
'GeneratorType': {'throw'},
57895789
'FrameLocalsProxyType': {'setdefault', 'pop', 'get'}
57905790
}
5791-
no_signature = {'FrameLocalsProxyType'}
57925791
self._test_module_has_signatures(types,
57935792
unsupported_signature=unsupported_signature,
5794-
methods_no_signature=methods_no_signature,
5795-
no_signature=no_signature)
5793+
methods_no_signature=methods_no_signature)
57965794

57975795
def test_sys_module_has_signatures(self):
57985796
no_signature = {'getsizeof', 'set_asyncgen_hooks'}

Objects/frameobject.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,15 @@ static PyMethodDef framelocalsproxy_methods[] = {
913913
{NULL, NULL} /* sentinel */
914914
};
915915

916+
PyDoc_STRVAR(framelocalsproxy_doc,
917+
"FrameLocalsProxy($frame)\n"
918+
"--\n"
919+
"\n"
920+
"Create a write-through view of the locals dictionary for a frame.\n"
921+
"\n"
922+
" frame\n"
923+
" the frame object to wrap.");
924+
916925
PyTypeObject PyFrameLocalsProxy_Type = {
917926
PyVarObject_HEAD_INIT(&PyType_Type, 0)
918927
.tp_name = "FrameLocalsProxy",
@@ -933,6 +942,7 @@ PyTypeObject PyFrameLocalsProxy_Type = {
933942
.tp_alloc = PyType_GenericAlloc,
934943
.tp_new = framelocalsproxy_new,
935944
.tp_free = PyObject_GC_Del,
945+
.tp_doc = framelocalsproxy_doc
936946
};
937947

938948
PyObject *

0 commit comments

Comments
 (0)