-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Expand file tree
/
Copy pathsentinelobject.c.h
More file actions
34 lines (29 loc) · 998 Bytes
/
sentinelobject.c.h
File metadata and controls
34 lines (29 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*[clinic input]
preserve
[clinic start generated code]*/
#include "pycore_modsupport.h" // _PyArg_CheckPositional()
static PyObject *
sentinel_new_impl(PyTypeObject *type, PyObject *name);
static PyObject *
sentinel_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
PyTypeObject *base_tp = &PySentinel_Type;
PyObject *name;
if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
!_PyArg_NoKeywords("sentinel", kwargs)) {
goto exit;
}
if (!_PyArg_CheckPositional("sentinel", PyTuple_GET_SIZE(args), 1, 1)) {
goto exit;
}
if (!PyUnicode_Check(PyTuple_GET_ITEM(args, 0))) {
_PyArg_BadArgument("sentinel", "argument 1", "str", PyTuple_GET_ITEM(args, 0));
goto exit;
}
name = PyTuple_GET_ITEM(args, 0);
return_value = sentinel_new_impl(type, name);
exit:
return return_value;
}
/*[clinic end generated code: output=7f28fc0bf0259cba input=a9049054013a1b77]*/