Opened 13 years ago

Last modified 8 years ago

#7921 closed enhancement

Categories for extension types via __getattr___ — at Version 4

Reported by: nthiery Owned by: nthiery
Priority: major Milestone: sage-4.3.2
Component: categories Keywords:
Cc: sage-combinat, mhansen, robertwb, roed Merged in:
Authors: Nicolas M. Thiéry Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by nthiery)

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. To start with, see #7922, #7929.

See patch description for details.

Patch also available on the sage-combinat server, with a +category guard: http://combinat.sagemath.org/hgwebdir.cgi/patches/file/tip/trac_7921-categories_for_extension_types-nt.patch

Change History (4)

comment:1 Changed 13 years ago by nthiery

  • Cc roed added; roe removed
  • Description modified (diff)

comment:2 Changed 13 years ago by nthiery

  • Description modified (diff)
  • Status changed from new to needs_work

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!

comment:3 Changed 13 years ago by nthiery

  • Description modified (diff)
  • Status changed from needs_work to needs_review

comment:4 Changed 13 years ago by nthiery

  • Description modified (diff)

The patch passes all tests with sage 4.3 + sage-combinat patches merged in 4.3.1 on my machine. I'll run sage -t -long tonight and report.

Note: See TracTickets for help on using tickets.