Closed konstin closed 1 month ago
Can we just add it to the report formatter?
We didn’t make the internal representation of range public because it is easy to break guaranties if you have access to it. If I’m not mistaken though there is an iterator that gives lets you iterate over segments bounds. Could you use that to make a custom function to convert to a string?
Isn't this exactly what #187 was intended to be used for? In your sample code self.segments.iter()
can be replaced with self.iter()
and it should all work.
Sorry, i missed the iter()
for not returning Interval
bit (Bound, Bound)
:facepalm:. I've put up a half-baked branch at https://github.com/astral-sh/uv/compare/main...konsti/pubgrub-range, the main task and verbosity is to forward all the utility methods of Range
(Maybe something for a trait? Feels a bit specific though).
In python, versions and version specifiers are formatted in particular way (PEP 440) that's different from pubgrub's default. We want to use the
pubgrub::range::Range
type for correctness and performance, but we'd like to override itsDisplay
impl. This is currently not possible with the newtype pattern due tosegments
ofRange
being private.For reference, this is
Display
impl we want: