>>> Your comment about the sum function suggests to me that something
>>> similar might be behind the weird thing I reported yesterday.
>>

Yep, this is exactly the cause. If you look at rational.pyx, it
includes libs/pari/decl.pxi, which contains a declaration for Pari's
sum function. This then takes precedence over the default python sum,
which is causing the trouble.

I can think of a few easy fixes:

1. We can just use string replace magic, so turn the line in decl.pxi into:

      GEN     pari_sum "sum"(GEN v, long a, long b)

This will mean we have to explicitly write pari_sum anytime we want
the pari functionality, but it would then get correctly replaced at
compile-time. Then we wouldn't run into this problem.

2. I suspect that the pari sum isn't used anywhere in Sage (for
instance, it's not used in gen.pyx). We could simply remove it from
decl.pxi, though I don't like that as much.

3. Something else completely? ...

I'm currently building/doctesting with (1) in place, and I'll report
back soon. gen.pyx passes all tests, so I suspect we're probably safe.

>> Yeah, we ought to suggest to the pari people to rename such generic
>
> I don't think they would rename "sum" to please us!
>

And I really really don't think they should. After all, the issue is
that python and pari both use the same name for something -- we might
as well be asking python to rename their sum function. (I don't think
Guido would go for it. :P) I think it's actually our fault for letting
one name accidentally override the other, not their fault for both
using the only natural name for that function.

-cc

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to