-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
Unfortunate type bound on Range #10414
Copy link
Copy link
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait systemE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.
Description
Activity
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.
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).