I had already bumped against this type compatibility
problem, which I solved by turning off sage's preparser:

preparser(False)

However, this error won't go away when the preparser is turned off.

Flávio


On 9 abr, 11:45, Robert Bradshaw <rober...@math.washington.edu> wrote:
> On Apr 9, 2009, at 3:34 AM, Flavio Coelho wrote:
>
> > Hi I having trouble with running code within sage which runs perfectly
> > in straight Python:
>
> ...
>
> > TypeError: array cannot be safely cast to required type
>
> > can anyone tell me if this is a Sage "bug" or "feature" ;-)
>
> My guess is that it's a NumPy bug--NumPy doesn't play well with Sage  
> types (including floating point numbers). One reason we do this is so  
> that
>
> sage: 1/3
>
> actually gives the rational number 1/3, rather than 0 (or some  
> floating point approximation). Sage code is run through a preparser  
> that wraps literals in Sage types.
>
> - Robert
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to