Opened 8 months ago

Closed 6 months ago

#27586 closed enhancement (worksforme)

Py3: Fix matrix/docs.py doctests errors

Reported by: vklein Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: python3 Keywords:
Cc: Merged in:
Authors: Vincent Klein Reviewers:
Report Upstream: N/A Work issues:
Branch: u/vklein/27586 (Commits) Commit: 4d569a5619aed5195c5a02f2bfdc561cf78ab1c7
Dependencies: Stopgaps:

Description

Fix matrix/docs.py doctests errors. Example :

File "src/sage/matrix/docs.py", line 115, in sage.matrix.docs
Failed example:
    M[range(2),:]
Exception raised:
    Traceback (most recent call last):
      File "/home/u1/chapoton/sage3/local/lib/python3.6/site-packages/sage/doctest/forker.py", line 671, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/u1/chapoton/sage3/local/lib/python3.6/site-packages/sage/doctest/forker.py", line 1095, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.matrix.docs[14]>", line 1, in <module>
        M[range(Integer(2)),:]
      File "sage/matrix/matrix0.pyx", line 926, in sage.matrix.matrix0.Matrix.__getitem__ (build/cythonized/sage/matrix/matrix0.c:6734)
        raise TypeError("index must be an integer")
    TypeError: index must be an integer

These errors were caused by range calls (range return iterator in py3).

Change History (8)

comment:1 follow-up: Changed 8 months ago by chapoton

possible conflict with #27585 ?

comment:2 Changed 8 months ago by vklein

  • Branch set to u/vklein/27586

comment:3 in reply to: ↑ 1 Changed 8 months ago by vklein

  • Commit set to 4d569a5619aed5195c5a02f2bfdc561cf78ab1c7

Replying to chapoton:

possible conflict with #27585 ?

It's ok #27585 doesn't modifiy matrix/docs.py


New commits:

4d569a5Trac 27586: Py3 Fix matrix/docs.py doctests

comment:4 Changed 8 months ago by vklein

  • Status changed from new to needs_review

comment:5 Changed 8 months ago by jhpalmieri

#27585 makes changes to allow M[range(2),:] to work with Python 3. In particular, it should fix the doctests you are changing. I would request that you put this on hold until #27585 is resolved.

comment:6 Changed 8 months ago by vklein

  • Status changed from needs_review to needs_info

My bad i have missed that point.

comment:7 Changed 8 months ago by vklein

  • Milestone changed from sage-8.8 to sage-duplicate/invalid/wontfix
  • Status changed from needs_info to positive_review

comment:8 Changed 6 months ago by chapoton

  • Resolution set to worksforme
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.