• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4 
5 PyDoc_STRVAR(_contextvars_Context_get__doc__,
6 "get($self, key, default=None, /)\n"
7 "--\n"
8 "\n");
9 
10 #define _CONTEXTVARS_CONTEXT_GET_METHODDEF    \
11     {"get", (PyCFunction)_contextvars_Context_get, METH_FASTCALL, _contextvars_Context_get__doc__},
12 
13 static PyObject *
14 _contextvars_Context_get_impl(PyContext *self, PyObject *key,
15                               PyObject *default_value);
16 
17 static PyObject *
_contextvars_Context_get(PyContext * self,PyObject * const * args,Py_ssize_t nargs)18 _contextvars_Context_get(PyContext *self, PyObject *const *args, Py_ssize_t nargs)
19 {
20     PyObject *return_value = NULL;
21     PyObject *key;
22     PyObject *default_value = Py_None;
23 
24     if (!_PyArg_UnpackStack(args, nargs, "get",
25         1, 2,
26         &key, &default_value)) {
27         goto exit;
28     }
29     return_value = _contextvars_Context_get_impl(self, key, default_value);
30 
31 exit:
32     return return_value;
33 }
34 
35 PyDoc_STRVAR(_contextvars_Context_items__doc__,
36 "items($self, /)\n"
37 "--\n"
38 "\n");
39 
40 #define _CONTEXTVARS_CONTEXT_ITEMS_METHODDEF    \
41     {"items", (PyCFunction)_contextvars_Context_items, METH_NOARGS, _contextvars_Context_items__doc__},
42 
43 static PyObject *
44 _contextvars_Context_items_impl(PyContext *self);
45 
46 static PyObject *
_contextvars_Context_items(PyContext * self,PyObject * Py_UNUSED (ignored))47 _contextvars_Context_items(PyContext *self, PyObject *Py_UNUSED(ignored))
48 {
49     return _contextvars_Context_items_impl(self);
50 }
51 
52 PyDoc_STRVAR(_contextvars_Context_keys__doc__,
53 "keys($self, /)\n"
54 "--\n"
55 "\n");
56 
57 #define _CONTEXTVARS_CONTEXT_KEYS_METHODDEF    \
58     {"keys", (PyCFunction)_contextvars_Context_keys, METH_NOARGS, _contextvars_Context_keys__doc__},
59 
60 static PyObject *
61 _contextvars_Context_keys_impl(PyContext *self);
62 
63 static PyObject *
_contextvars_Context_keys(PyContext * self,PyObject * Py_UNUSED (ignored))64 _contextvars_Context_keys(PyContext *self, PyObject *Py_UNUSED(ignored))
65 {
66     return _contextvars_Context_keys_impl(self);
67 }
68 
69 PyDoc_STRVAR(_contextvars_Context_values__doc__,
70 "values($self, /)\n"
71 "--\n"
72 "\n");
73 
74 #define _CONTEXTVARS_CONTEXT_VALUES_METHODDEF    \
75     {"values", (PyCFunction)_contextvars_Context_values, METH_NOARGS, _contextvars_Context_values__doc__},
76 
77 static PyObject *
78 _contextvars_Context_values_impl(PyContext *self);
79 
80 static PyObject *
_contextvars_Context_values(PyContext * self,PyObject * Py_UNUSED (ignored))81 _contextvars_Context_values(PyContext *self, PyObject *Py_UNUSED(ignored))
82 {
83     return _contextvars_Context_values_impl(self);
84 }
85 
86 PyDoc_STRVAR(_contextvars_Context_copy__doc__,
87 "copy($self, /)\n"
88 "--\n"
89 "\n");
90 
91 #define _CONTEXTVARS_CONTEXT_COPY_METHODDEF    \
92     {"copy", (PyCFunction)_contextvars_Context_copy, METH_NOARGS, _contextvars_Context_copy__doc__},
93 
94 static PyObject *
95 _contextvars_Context_copy_impl(PyContext *self);
96 
97 static PyObject *
_contextvars_Context_copy(PyContext * self,PyObject * Py_UNUSED (ignored))98 _contextvars_Context_copy(PyContext *self, PyObject *Py_UNUSED(ignored))
99 {
100     return _contextvars_Context_copy_impl(self);
101 }
102 
103 PyDoc_STRVAR(_contextvars_ContextVar_get__doc__,
104 "get($self, default=None, /)\n"
105 "--\n"
106 "\n");
107 
108 #define _CONTEXTVARS_CONTEXTVAR_GET_METHODDEF    \
109     {"get", (PyCFunction)_contextvars_ContextVar_get, METH_FASTCALL, _contextvars_ContextVar_get__doc__},
110 
111 static PyObject *
112 _contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value);
113 
114 static PyObject *
_contextvars_ContextVar_get(PyContextVar * self,PyObject * const * args,Py_ssize_t nargs)115 _contextvars_ContextVar_get(PyContextVar *self, PyObject *const *args, Py_ssize_t nargs)
116 {
117     PyObject *return_value = NULL;
118     PyObject *default_value = NULL;
119 
120     if (!_PyArg_UnpackStack(args, nargs, "get",
121         0, 1,
122         &default_value)) {
123         goto exit;
124     }
125     return_value = _contextvars_ContextVar_get_impl(self, default_value);
126 
127 exit:
128     return return_value;
129 }
130 
131 PyDoc_STRVAR(_contextvars_ContextVar_set__doc__,
132 "set($self, value, /)\n"
133 "--\n"
134 "\n");
135 
136 #define _CONTEXTVARS_CONTEXTVAR_SET_METHODDEF    \
137     {"set", (PyCFunction)_contextvars_ContextVar_set, METH_O, _contextvars_ContextVar_set__doc__},
138 
139 PyDoc_STRVAR(_contextvars_ContextVar_reset__doc__,
140 "reset($self, token, /)\n"
141 "--\n"
142 "\n");
143 
144 #define _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF    \
145     {"reset", (PyCFunction)_contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__},
146 /*[clinic end generated code: output=d9a675e3a52a14fc input=a9049054013a1b77]*/
147