| 1 |
/*[clinic input] |
| 2 |
preserve |
| 3 |
[clinic start generated code]*/ |
| 4 |
|
| 5 |
#include "pycore_modsupport.h" // _PyArg_CheckPositional() |
| 6 |
|
| 7 |
PyDoc_STRVAR(_suggestions__generate_suggestions__doc__, |
| 8 |
"_generate_suggestions($module, candidates, item, /)\n" |
| 9 |
"--\n" |
| 10 |
"\n" |
| 11 |
"Returns the candidate in candidates that\'s closest to item"); |
| 12 |
|
| 13 |
#define _SUGGESTIONS__GENERATE_SUGGESTIONS_METHODDEF \ |
| 14 |
{"_generate_suggestions", _PyCFunction_CAST(_suggestions__generate_suggestions), METH_FASTCALL, _suggestions__generate_suggestions__doc__}, |
| 15 |
|
| 16 |
static PyObject * |
| 17 |
_suggestions__generate_suggestions_impl(PyObject *module, |
| 18 |
PyObject *candidates, PyObject *item); |
| 19 |
|
| 20 |
static PyObject * |
| 21 |
_suggestions__generate_suggestions(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
| 22 |
{ |
| 23 |
PyObject *return_value = NULL; |
| 24 |
PyObject *candidates; |
| 25 |
PyObject *item; |
| 26 |
|
| 27 |
if (!_PyArg_CheckPositional("_generate_suggestions", nargs, 2, 2)) { |
| 28 |
goto exit; |
| 29 |
} |
| 30 |
candidates = args[0]; |
| 31 |
if (!PyUnicode_Check(args[1])) { |
| 32 |
_PyArg_BadArgument("_generate_suggestions", "argument 2", "str", args[1]); |
| 33 |
goto exit; |
| 34 |
} |
| 35 |
item = args[1]; |
| 36 |
return_value = _suggestions__generate_suggestions_impl(module, candidates, item); |
| 37 |
|
| 38 |
exit: |
| 39 |
return return_value; |
| 40 |
} |
| 41 |
/*[clinic end generated code: output=1d8e963cdae30b13 input=a9049054013a1b77]*/ |