#7921: Categories for extension types via __getattr___
---------------------------+------------------------------------------------
Reporter: nthiery | Owner: nthiery
Type: enhancement | Status: needs_work
Priority: major | Milestone:
Component: categories | Keywords:
Work_issues: | Author: Nicolas M. ThiƩry
Upstream: N/A | Reviewer:
Merged: |
---------------------------+------------------------------------------------
Changes (by nthiery):
* status: new => needs_work
Old description:
> With this patch, all parents and elements can inherit code from
> categories, even extension types. This includes in particular
> generic tests (see TestSuite(...).run()):
> {{{
> sage: ZZ.category()
> Category of commutative rings
> 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
> }}}
>
> It is to be expected that this will catch bugs in many places in the
> library.
>
> The implementation uses __getattr__ and has some limitations (e.g.
> handling of lazy attributes), though.
New description:
With this patch, all parents and elements can inherit code from
categories, even extension types. This includes in particular
generic tests (see TestSuite(...).run()):
{{{
sage: ZZ.category()
Category of commutative rings
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
}}}
It is to be expected that this will catch bugs in many places in the
library.
The implementation uses __getattr__ and has some limitations (e.g.
handling of lazy attributes), though.
Patch on:
http://combinat.sagemath.org/hgwebdir.cgi/patches/file/tip/trac_7921
-categories_for_extension_types-nt.patch
--
Comment:
All tests seem to pass with it on 4.3; I still need to double check a
couple things. It does change things in many places; so the best would be
to integrate it in the early phase of 4.3.2 before it rots away.
Early feedback welcome!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7921#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.