Hi, Given the recent discussion on adding generic group features, it was way time for someone to go one step further: to enable extension types to inherit code from categories, so that we could at last start to systematically put generic code in the categories instead of the "old" abstract class hierarchy (or at least the non time-critical code).
You'll find an attempt on #7921! Well, so far, most categories that are not relevant to combinatorics are fairly empty. So for the moment, the main improvement this brings to Sage is the availability of generic tests: sage: ZZ.category() # Finally!!!! Category of euclidean domains sage: TestSuite(ZZ).run(verbose = True) running ._test_additive_associativity() . . . pass running ._test_an_element() . . . pass running ._test_associativity() . . . pass running ._test_element_pickling() . . . pass running ._test_not_implemented_methods() . . . pass running ._test_one() . . . pass running ._test_pickling() . . . pass running ._test_prod() . . . pass running ._test_some_elements() . . . pass running ._test_zero() . . . pass So far, TestSuite is not used much; yet, just doing this change already revealed a couple pickling issues (#7922, #7929). The next step will be to systematically replace all loads/dumps tests with TestSuite. It would be best for this step to be done by the authors of the various Sage modules. I do expect that this will reveal much more issues. Especially when others will start adding more generic tests to the categories (it's easy! go ahead! I'll make a point at reviewing it!) The patch in #7921 goes with the getattr approach with its caveats. Yet all test pass on my machine. And hopefully some day extension types will have native support for multiple inheritance from abstract classes as we discussed with Robert. The getattr code itself small. On the other hand, I had to make little fixes in many places, including some where I am completely ignorant (schemes, Cython arcanes, ...). Along the way the patch cleans up a couple things in the way categories are declared here and there. Altogether the patch is 2000 lines long and touches 46 files. This should be a fairly quick review, but it needs to be done with care. I uploaded a (final?) version on trac. Early feedback before starting the full review most welcome. This patch is susceptible to rot away very quickly, and I won't have much time to keep it alive. So, I would love if it was possible to have it applied very early in the 4.3.2 release cycle. Robert M/B, David Roe, Craig, or someone else: any chances for you to review it shortly? Thanks much in advance! Cheers, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/
-- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org