id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
3704 [with patch, positive review] make diagonal_matrix accept much more general arguments jkantor was "So I think this is a bug
{{{
sage: w=vector(RR,[1,2,3])
sage: d=diagonal_matrix(w)
UnboundLocalError: local variable 'v' referenced before assignment
}}}
The following fails as well
{{{
sage: d=diagonal_matrix(RR,w)
}}}
the only thing that works is
{{{
sage: d=diagonal_matrix(RR,list(w))
}}}
A stupid but easy fix is to try to turn any argument to diagonal_matrix into a list before bailing out (its in matrix/constructor.py), but there should probably be logic actually expecting vectors and analyzing the parents?" defect closed major sage-3.3 linear algebra fixed