Range has a type bound on ToPrimitive so that it can have a size_hint. It does not need this to function, and the size_hint is just an optional nicety.
It'd be nice if there were some way to express this with the type system; this "optional" type bound makes the interface less generic (though it's not that big of a deal).
Range has a type bound on ToPrimitive so that it can have a size_hint. It does not need this to function, and the size_hint is just an optional nicety.
It'd be nice if there were some way to express this with the type system; this "optional" type bound makes the interface less generic (though it's not that big of a deal).