{
    "mode": "pydoc",
    "parameter": "_bisect",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/_bisect/json",
    "generated": "2026-06-02T13:19:34Z",
    "sections": {
        "NAME": {
            "content": "bisect - Bisection algorithms.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module provides support for maintaining a list in sorted order without\nhaving to sort the list after each insertion. For long lists of items with\nexpensive comparison operations, this can be an improvement over the more\ncommon approach.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "bisect_left",
                    "content": "Return the index where to insert item x in list a, assuming a is sorted.\n\nThe return value i is such that all e in a[:i] have e < x, and all e in\na[i:] have e >= x.  So if x already appears in the list, a.insert(i, x) will\ninsert just before the leftmost x already there.\n\nOptional args lo (default 0) and hi (default len(a)) bound the\nslice of a to be searched.\n"
                },
                {
                    "name": "bisect_right",
                    "content": "Return the index where to insert item x in list a, assuming a is sorted.\n\nThe return value i is such that all e in a[:i] have e <= x, and all e in\na[i:] have e > x.  So if x already appears in the list, a.insert(i, x) will\ninsert just after the rightmost x already there.\n\nOptional args lo (default 0) and hi (default len(a)) bound the\nslice of a to be searched.\n"
                },
                {
                    "name": "insort_left",
                    "content": "Insert item x in list a, and keep it sorted assuming a is sorted.\n\nIf x is already in a, insert it to the left of the leftmost x.\n\nOptional args lo (default 0) and hi (default len(a)) bound the\nslice of a to be searched.\n"
                },
                {
                    "name": "insort_right",
                    "content": "Insert item x in list a, and keep it sorted assuming a is sorted.\n\nIf x is already in a, insert it to the right of the rightmost x.\n\nOptional args lo (default 0) and hi (default len(a)) bound the\nslice of a to be searched.\n"
                }
            ]
        },
        "FILE": {
            "content": "(built-in)\n\n",
            "subsections": []
        }
    },
    "summary": "bisect - Bisection algorithms.",
    "flags": [],
    "examples": [],
    "see_also": []
}