Skip to content

Conversation

@idanmiara
Copy link

Closes #91

  • Major refactor
  • Added a StableSet implementation, as a base class for OrderedSet.
  • Added Many functions to OrderedSet, to be more complete and more compatible with other implementations.
    • popitem(last: bool = True), similar to dict.popitem (note minor incompatibility with another implementation (orderedset) that have the last keyword in the pop function)
    • move_to_end(key), similar to dict.move_to_end
    • le, lt, ge, gt - to improve subset/superset testing
  • Minimum Python version is 3.8 (because reversed)
  • Fix: OrderedSet.update now raised a TypeError instead of a ValueError when the type of the input is incorrect
  • Added many new tests, and all the tests from 2 other implementations.

…atures

- Added a StableSet implementation, as a base class for OrderedSet.
- Added Many functions to OrderedSet, to be more complete and more compatible with other implementations.
  - popitem(last: bool = True), similar to `dict.popitem` (note minor incompatibility with another implementation (`orderedset`) that have the `last` keyword in the `pop` function)
  - move_to_end(key), similar to `dict.move_to_end`
  - __le__, __lt__, __ge__, __gt__ - to improve subset/superset testing
- Minimum Python version is 3.8 (because __reversed__)
- Fix: OrderedSet.update now raised a TypeError instead of a ValueError when the type of the input is incorrect
@rspeer
Copy link
Owner

rspeer commented Aug 9, 2024

I can see why these would be desired features, but I don't want to increase the scope of this library. I'd have no ill will if you just released and packaged your own fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge upstream? StableSet: Adding an additional implementation, new features and tests and more.

2 participants