1 | | With this patch, all parents and elements can inherit code from categories. This is implemented via __getattr__. |
| 1 | With this patch, all parents and elements can inherit code from categories, even extension types. This includes in particular |
| 2 | generic tests (see TestSuite(...).run()): |
| 3 | {{{ |
| 4 | sage: ZZ.category() |
| 5 | Category of commutative rings |
| 6 | sage: TestSuite(ZZ).run(verbose = True) |
| 7 | running ._test_additive_associativity() . . . pass |
| 8 | running ._test_an_element() . . . pass |
| 9 | running ._test_associativity() . . . pass |
| 10 | running ._test_element_pickling() . . . pass |
| 11 | running ._test_not_implemented_methods() . . . pass |
| 12 | running ._test_one() . . . pass |
| 13 | running ._test_pickling() . . . pass |
| 14 | running ._test_prod() . . . pass |
| 15 | running ._test_some_elements() . . . pass |
| 16 | running ._test_zero() . . . pass |
| 17 | }}} |
| 18 | |
| 19 | It is to be expected that this will catch bugs in many places in the library. |
| 20 | |
| 21 | The implementation uses __getattr__ and has some limitations (e.g. handling of lazy attributes), though. |