summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/_suggestions.c.h
blob: 51484b13d5af89cf0457b7ad491cb0451d12f154 (plain)
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
35
36
37
38
39
40
41
/*[clinic input]
preserve
[clinic start generated code]*/

#include "pycore_modsupport.h"    // _PyArg_CheckPositional()

PyDoc_STRVAR(_suggestions__generate_suggestions__doc__,
"_generate_suggestions($module, candidates, item, /)\n"
"--\n"
"\n"
"Returns the candidate in candidates that\'s closest to item");

#define _SUGGESTIONS__GENERATE_SUGGESTIONS_METHODDEF    \
    {"_generate_suggestions", _PyCFunction_CAST(_suggestions__generate_suggestions), METH_FASTCALL, _suggestions__generate_suggestions__doc__},

static PyObject *
_suggestions__generate_suggestions_impl(PyObject *module,
                                        PyObject *candidates, PyObject *item);

static PyObject *
_suggestions__generate_suggestions(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
    PyObject *return_value = NULL;
    PyObject *candidates;
    PyObject *item;

    if (!_PyArg_CheckPositional("_generate_suggestions", nargs, 2, 2)) {
        goto exit;
    }
    candidates = args[0];
    if (!PyUnicode_Check(args[1])) {
        _PyArg_BadArgument("_generate_suggestions", "argument 2", "str", args[1]);
        goto exit;
    }
    item = args[1];
    return_value = _suggestions__generate_suggestions_impl(module, candidates, item);

exit:
    return return_value;
}
/*[clinic end generated code: output=1d8e963cdae30b13 input=a9049054013a1b77]*/