Skip to content

Merge SortedList and SortedKeyList Into a Single Class #248

@xintenseapple

Description

@xintenseapple

From what I can tell, SortedList and SortedKeyList are functionally interchangeable aside from the slight memory overhead of the SortedKeyList._keys list in SortedKeyList. A simpler implementation would be to use SortedKeyList for everything and default the key to the identity function, which is actually already the case for SortedKeyList. This would allow removal of the custom SortedList.__new__ function and, more importantly, properly type hint the classes and methods without getting invalid signatures.

Is there are concrete reason these classes exist separately other than the small overhead associated with SortedKeyList._keys?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions