Closed thetorpedodog closed 1 year ago
Update: Since mypy doesn’t currently understand SomeABC.register(other_type)
, that approach Did Not Work well in reality. Instead, I’ve just removed the runtime_checkable
ility of the protocol and made is_slice_of
the canonical type-checking method.
Oops, had not noticed the approval. Reverting to the approved state (i.e. no longer removing Comparable
) and saving that for another change.
Since
range
has the membersstart
/stop
/step
, that meant thatisinstance(range(x), Slice)
would return True, when arange
is not aSlice
. Usingabc
and manually registeringslice
fixes this.This also unrestricts
Slice
s from beingComparable
, since the built-inslice
type does not have this restriction, and adds theis_slice_of
function, taken fromtiledbsoma
.