@@ -107,9 +107,9 @@ Context variable functions:
107
107
.. c :function :: PyObject *PyContextVar_New (const char *name, PyObject *def)
108
108
109
109
Create a new ``ContextVar `` object. The *name * parameter is used
110
- for introspection and debug purposes. The *def * parameter may optionally
111
- specify the default value for the context variable. If an error has
112
- occurred, this function returns ``NULL ``.
110
+ for introspection and debug purposes. The *def * parameter specifies
111
+ a default value for the context variable, or `` NULL `` for no default.
112
+ If an error has occurred, this function returns ``NULL ``.
113
113
114
114
.. c :function :: int PyContextVar_Get (PyObject *var, PyObject *default_value, PyObject **value)
115
115
@@ -124,13 +124,12 @@ Context variable functions:
124
124
- the default value of *var *, if not ``NULL ``;
125
125
- ``NULL ``
126
126
127
- If the value was found , the function will create a new reference to it .
127
+ Except for `` NULL `` , the function returns a new reference.
128
128
129
129
.. c :function :: PyObject *PyContextVar_Set (PyObject *var, PyObject *value)
130
130
131
- Set the value of *var * to *value * in the current context. Returns a
132
- pointer to a :c:type: `PyObject ` object, or ``NULL `` if an error
133
- has occurred.
131
+ Set the value of *var * to *value * in the current context. Returns
132
+ a new token object for this change, or ``NULL `` if an error has occurred.
134
133
135
134
.. c :function :: int PyContextVar_Reset (PyObject *var, PyObject *token)
136
135
0 commit comments