summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/context.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/context.c b/Python/context.c
index b727748..8ee048c 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -940,6 +940,10 @@ contextvar_cls_getitem(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
+static PyMemberDef PyContextVar_members[] = {
+ {"name", T_OBJECT, offsetof(PyContextVar, var_name), READONLY},
+ {NULL}
+};
static PyMethodDef PyContextVar_methods[] = {
_CONTEXTVARS_CONTEXTVAR_GET_METHODDEF
@@ -955,6 +959,7 @@ PyTypeObject PyContextVar_Type = {
"ContextVar",
sizeof(PyContextVar),
.tp_methods = PyContextVar_methods,
+ .tp_members = PyContextVar_members,
.tp_dealloc = (destructor)contextvar_tp_dealloc,
.tp_getattro = PyObject_GenericGetAttr,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,