Le 12/03/2015 17:03, Marc Mezzarobba a écrit :
Bruno Grenet wrote:
My questions: Is my understanding correct? If not, what are supposed
these arguments to be for? And if I understand correctly, is the
behavior I mention a bug?
I'd say you are right, and the reason for the bug is that ETuple changed
after Polydict was written. Compare 5c1f8e65 to 79db8b7f.



Actually, I have the impression that there are several problems mixed there:

- Regardless of the value of force_etuples, PolyDict uses the class ETuple (at line 95): to me this is a first problem since force_etuples does not work as intended;

- The class ETuple was rewritten by Joel B. Mohler in March 2008 (commit 5813bbb4) and then improved in ticket #10834 by Mario Pernici (commit 9a60cc3a). These two commits together forbid one to use non-int exponents in ETuple.

There are at least two possible workarounds for these problems I guess:

- Make the force_etuples and force_int_exponents have their intended behavior by not using ETuple if force_etuples or force_int_exponents is False. Note that both arguments have the same consequences so could be merged. One problem is that many methods of PolyDict explicitly use ETuple and I have not checked if and how this can be avoided.

- Make Etuple accept non-int exponents, maybe with a optional argument to keep the fast implementation for int exponents while allowing a slower implementation for non-int exponents. In such case, the force_int_exponents and force_etuples arguments may be removed.

Another possibility, that I do not like but that other people may prefer, is to keep the ETuple and PolyDict classes as they are now, simply removing the arguments force_etuples and force_int_exponents since they have no effect.

I feel like it is a shame that PolyDict only handle int exponents, and to me this was a regression when ETuple was rewritten. What do you think? At least, the current documentation does not agree with the behavior.

--
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 [email protected].
To post to this group, send email to [email protected].
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