Some comments:

Non-underscore attributes implement a mutable interface. You are inviting 
your users to modify field.tensor_type = (1,2), which will almost certanly 
lead to inconsistent objects. In Sage, the convention is generally to use 
underscore attributes and ensure immutability through accessor methods. An 
alternative would be read-only attributes, but this is generally not used 
in Sage.

The split ScalarField  <-> ZeroScalarField duplicates value information in 
the type. This is awkward for the implementation where you always have to 
check and make sure that algebraic operations don't accidentally create a 
ScalarField that happens to be zero. If you really need to be able to tell 
quickly if a field is zero just cache .is_zero()

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
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