-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Proposal: Introduce Higher Level APIs like ceil / floor #207
Comments
There’s already an existing API for these operations. See https://grantjenks.com/docs/sortedcontainers/sortedlist.html#sortedcontainers.SortedList.irange The advantage of irange is that it does not require the positional index to be built. The irange method is available on all provided data types. From a design point of view, I’d rather keep a smaller surface than larger one, especially as the functionality here is rather easily implemented using existing APIs. |
Actually, I have two concerns related to the above API (irange) since
I feel we can keep opening this issue and see how other people react to this discussion. |
One thought looking over the issue today: would we also need to add |
Motivation
Other programming languages support high-level APIs like
In Tree data structure.
We can achieve this by using bisect method + index range check, but providing higher-level API would help users to avoid writing wrapper code every time.
API Definition
SortedList
SortedSet
SortedDict
Prototype Code (Implementation / Tests)
P.S
The text was updated successfully, but these errors were encountered: