#19134: Inconsistency in matrix()
------------------------------+----------------------------
   Reporter:  mmezzarobba     |            Owner:
       Type:  defect          |           Status:  new
   Priority:  minor           |        Milestone:  sage-6.9
  Component:  linear algebra  |         Keywords:
  Merged in:                  |          Authors:
  Reviewers:                  |  Report Upstream:  N/A
Work issues:                  |           Branch:
     Commit:                  |     Dependencies:
   Stopgaps:                  |
------------------------------+----------------------------
 {{{
 sage: matrix(2, 3, [])
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-11-2927290cdaf3> in <module>()
 ----> 1 matrix(Integer(2), Integer(3), [])

 /home/marc/opt/sage/local/lib/python2.7/site-
 packages/sage/matrix/constructor.pyc in _matrix_constructor(*args, **kwds)
     647
     648             if nrows > 0 and ncols > 0 and ring is None:
 --> 649                 entries, ring = prepare(entries)
     650
     651         elif isinstance(args[0], dict):

 /home/marc/opt/sage/local/lib/python2.7/site-
 packages/sage/matrix/constructor.pyc in prepare(w)
     794         TypeError: unable to find a common ring for all elements
     795     """
 --> 796     if 0 == len(w):
     797         return Sequence([], rings.ZZ), rings.ZZ
     798     entries = Sequence(w)

 TypeError: object of type 'int' has no len()
 }}}

 Compare:
 {{{
 sage: matrix(ZZ, 2, 3, [])
 [0 0 0]
 [0 0 0]
 sage: matrix(2, 3, [1])
 ...
 ValueError: entries has the wrong length
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/19134>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to