Skip to content

Commit 78b842c

Browse files
committed
Expose FrameLocalsProxy in types and _types
1 parent 236f733 commit 78b842c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Lib/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def _m(self): pass
6969
EllipsisType = type(Ellipsis)
7070
NoneType = type(None)
7171
NotImplementedType = type(NotImplemented)
72+
FrameLocalsProxy = (lambda: type(sys._getframe().f_locals)()
7273

7374
# CapsuleType cannot be accessed from pure Python,
7475
# so there is no fallback definition.

Modules/_typesmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ _types_exec(PyObject *m)
4646
EXPORT_STATIC_TYPE("TracebackType", PyTraceBack_Type);
4747
EXPORT_STATIC_TYPE("UnionType", _PyUnion_Type);
4848
EXPORT_STATIC_TYPE("WrapperDescriptorType", PyWrapperDescr_Type);
49+
EXPORT_STATIC_TYPE("FrameLocalsProxy", PyFrameLocalsProxy_Type);
4950
#undef EXPORT_STATIC_TYPE
5051
return 0;
5152
}

0 commit comments

Comments
 (0)