Opened 9 years ago

Closed 9 years ago

#8704 closed enhancement (fixed)

Improve the _repr_ of IntegerRange

Reported by: hivert Owned by: hivert
Priority: major Milestone: sage-4.4.4
Component: combinatorics Keywords: integer range
Cc: Merged in: sage-4.4.4.alpha0
Authors: Florent Hivert Reviewers: Mike Hansen
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by hivert)

The actual printing was discussed on this thread of sage-combinat-devel.

I also took the chance of normalizing the input to improve equality.

Attachments (1)

trac_8704-integer_range_print-fh.patch (14.2 KB) - added by hivert 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 9 years ago by hivert

  • Description modified (diff)
  • Keywords integer range added
  • Milestone set to sage-4.4.2
  • Status changed from new to needs_review
  • Type changed from defect to enhancement

comment:2 Changed 9 years ago by hivert

I fixed a doctest failure... All tests should pass now.

comment:3 Changed 9 years ago by hivert

I fixed the following issues raised by Nicolas on sage-combinat-devel

> >> The output of IntegerRange is much nicer now. I was about to put a
> >> positive review, when I had a last doubt about the consistency between:
> >>
> >>      sage: I = IntegerRange(2,100,5); I
> >>      {2, 7 .. 97}
> >>      sage: I = IntegerRange(54,Infinity,3); I
> >>      {54, 57, ..}
> >>
> >> Should there be a comma in both cases, in none, or is it good as is?
> >
> > I would say {2, 7 .. 97} should be replaced by {2, 7, .., 97} for
> > consistency.

Changed 9 years ago by hivert

comment:4 Changed 9 years ago by mhansen

  • Reviewers set to Mike Hansen
  • Status changed from needs_review to positive_review

Looks good to me.

comment:5 Changed 9 years ago by mhansen

  • Merged in set to sage-4.4.4.alpha0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.