Changes between Version 44 and Version 51 of Ticket #11935


Ignore:
Timestamp:
04/25/12 14:22:12 (8 years ago)
Author:
nthiery
Comment:

Hi Simon,

I reworked the patch by adding features to dynamic_class in order to avoid logic duplication and encapsulation breaking in make_named_class.

The downside is that this makes this ticket depend on #12876 (ensuring that parent/element classes are purely abstract).

All test should pass on 5.0.beta13, except for the two issues I mentionned in #12876. Oh, and one trivial failure I had forgotten in semigroup_cython.pyx. I'll update the patch later (tonight?) but you can start the review.

I folded the two patches to get a better overview. You can access the differential patch by looking up http://combinat.sagemath.org/patches/file/3121811e2ebe/trac11935_weak_pickling_by_construction_rel11943-review-nt.patch.

Cheers,

Nicolas

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11935

    • Property Cc sage-combinat added
    • Property Dependencies changed from #9138 #11900 #11943 to #9138, #11900, #11943, #12875, #12876, #12877
  • Ticket #11935 – Description

    v44 v51  
    11At #11900 and [http://groups.google.com/group/sage-combinat-devel/browse_thread/thread/99c74827d704e677 sage-combinat-devel], as well as in some comments in sage/categories/category.py, the idea was discussed to make, for example, `Algebras(GF(3)).parent_class==Algebras(GF(5)).parent_class` - hence, make the parent/element classes as independent from the base of a category as possible.
     2
     3This is implemented in this patch by introducing an abstract class
     4CategoryWithParameters which uses pickling by "weak construction" for
     5its element and parent classes. In the process, this patch also:
     6
     7- Adds a method Category._make_named_class providing a unified way to
     8  create parent and element classes (and later on morphism classes)
     9- Extends the interface of dynamic_class to customize caching and pickling
     10
     11
    212
    313__Apply__
    414
    5  * [attachment:trac11935_weak_pickling_by_construction_rel11943.patch]
     15 * [attachment:trac11935_weak_pickling_by_construction_rel11943-nt.patch]