On Friday, April 24, 2015 at 6:37:45 AM UTC-7, Peter Mueller wrote:

> One of my favorite examples is ``numerical approximation'' of permutation 
> group elements ...
>
> sage: x = SymmetricGroup(5).random_element()
> sage: 'numerical_approx' in dir(x)
> True
>
> ... and this is not the only method offered for x which doesn't make any 
> sense at all.
>
 
I think it mainly illustrates that one shouldn't expect all items in dir(x) 
to be useful methods on your particular object x. This is generally the 
case in python. The "numerical_approx" method comes from 
sage.structure.element and it is a fairly sensible approach: try to find a 
numerical approximation to an element by trying to coerce it into a field 
(actually, first try an dispatch via x._numerical_approx). To have that 
functionality, sage.structure.element is not a bad place to implement it 
and consequently, symmetric group elements will inherit it and the method 
will fail on them.

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

Reply via email to