PyDocs

Nav

Data Types

insort_right

bisect

function
  • insort_right(a, x, lo=0, hi=len(a), *, key=None)
Insert item x in list a, and keep it sorted assuming a is sorted.

If x is already in a, insert it to the right of the rightmost x.

Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.

A custom key function can be supplied to customize the sort order.
Changed in 3.10
  • 3.10: Added the key parameter.
0 Examples
No examples for bisect/insort_right.
See Also
No see-alsos for bisect/insort_right
0 Notes
No notes for insort_right