Switched SortedList base class to Sequence#139
Switched SortedList base class to Sequence#139pganssle wants to merge 1 commit intograntjenks:masterfrom
Conversation
|
Those methods are a remnant of blist's implementation which include all the MutableSequence methods. It's been helpful, as a drop-in replacement, to have those methods implemented and raising NotImplementedError with useful error messages and doc strings. Raising AttributeError will be much more cryptic for folks. Otherwise, I don't see much benefit with this change except appeasing type checkers which seems kind of dubious to me. Did you see a specific case where a type checker would have caught your concern? |
I have implemented a custom
I have recently been trying to upgrade Same thing with regards to dispatch - people dispatching on |
Since SortedList does not implement the MutableSequence interface (many of MutableSequence's mixin methods return NotImplemented), it should not derive from MutableSequence. This change will allow type checkers to properly reject SortedList as an argument to a function that takes MutableSequence. This is a breaking change (albeit a minor one).
60ef803 to
4148246
Compare
Since SortedList does not implement the MutableSequence interface (many of MutableSequence's mixin methods return NotImplemented), it should not derive from MutableSequence.
This change will allow type checkers to properly reject SortedList as an argument to a function that takes MutableSequence.
This is a breaking change (albeit a minor one).
Fixes #138