Tiebreaker needed:

We have a whole bunch of ways in which a matrix can be constructed. Some of 
the possible signatures we support according to the documentation:

A)

matrix(n,m, <callable f>)

which constructs the n x m matrix with entries f(i,j), where i,j run throw 
the row and column indices.

B)

matrix(n,n, c)

which produces c times the n x n identity matrix.

These signatures clash when "c" is also a callable:

sage: R.<x,y>=ZZ[]
sage: matrix(3,3,x+y)

Presently, this chooses option B). This is because we don't actually 
support A) in the way we advertise: instead of testing whether f is 
callable, we test if f is an instance of some particular types.
We should of course instead test if f is callable, because that is what we 
advertise and that is the thing to do in python, but then we change the 
preference between A) and B).

The proper solution is to do away with at least one of A) or B), since they 
cannot co-exist (as this example shows), but that's not going to be an 
option due to backward compatibility.  How else break ties? Is there a way 
to recognize if a callable element is better treated as a scalar? 
Presently, option B) only succeeds as a last-ditch attempt.

This came up at: http://trac.sagemath.org/ticket/18713

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" 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-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to