Opened 5 years ago

Closed 5 years ago

#22816 closed enhancement (fixed)

py3 again some care for range

Reported by: chapoton Owned by:
Priority: major Milestone: sage-8.0
Component: python3 Keywords:
Cc: jdemeyer, tscrim Merged in:
Authors: Frédéric Chapoton Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: be9e797 (Commits, GitHub, GitLab) Commit: be9e797bd28bc06441313b8e16da0dd2640473f7
Dependencies: Stopgaps:

Status badges


part of #16081

Change History (7)

comment:1 Changed 5 years ago by chapoton

  • Branch set to u/chapoton/22816
  • Commit set to be9e797bd28bc06441313b8e16da0dd2640473f7
  • Status changed from new to needs_review

New commits:

be9e797some more care for range..

comment:2 Changed 5 years ago by tscrim

  • Cc jdemeyer tscrim added

The only change I am not sure about is this one:

  • src/sage/matrix/matrix0.pyx

    diff --git a/src/sage/matrix/matrix0.pyx b/src/sage/matrix/matrix0.pyx
    index c5959f0..50b5d00 100644
    a b cdef class Matrix(sage.structure.element.Matrix): 
    51775177            if not B[self._nrows-1, self._ncols-1]:
    51785178                raise ZeroDivisionError("input matrix must be nonsingular")
    5180         return B.matrix_from_columns(range(self._ncols, 2*self._ncols))
     5180        return B.matrix_from_columns(list(xrange(self._ncols, 2 * self._ncols)))
    51825182    def __pos__(self):
    51835183        """

I forget if Cython keeps the behavior that range will return a list in Python3. If it will, then I'm good with the change, otherwise, then I'd like to know if Cython optimizes this.

comment:3 Changed 5 years ago by tscrim


comment:4 Changed 5 years ago by chapoton

I have no idea..

comment:5 Changed 5 years ago by chapoton

There are already a few list(xrange(...)) in the very same file..

comment:6 Changed 5 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

Fair point.

comment:7 Changed 5 years ago by vbraun

  • Branch changed from u/chapoton/22816 to be9e797bd28bc06441313b8e16da0dd2640473f7
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.