{
    "mode": "pydoc",
    "parameter": "_functools",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/_functools/json",
    "generated": "2026-06-02T14:17:02Z",
    "sections": {
        "NAME": {
            "content": "functools - Tools that operate on functions.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "cmp_to_key",
                    "content": "Convert a cmp= function into a key= function.\n"
                },
                {
                    "name": "reduce",
                    "content": "reduce(function, iterable[, initial]) -> value\n\nApply a function of two arguments cumulatively to the items of a sequence\nor iterable, from left to right, so as to reduce the iterable to a single\nvalue.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates\n((((1+2)+3)+4)+5).  If initial is present, it is placed before the items\nof the iterable in the calculation, and serves as a default when the\niterable is empty.\n"
                }
            ]
        },
        "FILE": {
            "content": "(built-in)\n\n",
            "subsections": []
        }
    },
    "summary": "functools - Tools that operate on functions.",
    "flags": [],
    "examples": [],
    "see_also": []
}