Opened 12 years ago

Closed 12 years ago

#8524 closed defect (fixed)

DisjointUnionEnumeratedSets should have a private __classcall__ method

Reported by: hivert Owned by: hivert
Priority: major Milestone: sage-4.4
Component: combinatorics Keywords: DisjointUnionEnumeratedSets, inheritance
Cc: sage-combinat Merged in: sage-4.4.alpha1
Authors: Florent Hivert Reviewers: Nicolas M. Thiéry
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by nthiery)

In order to be easily inherited from, DisjointUnionEnumeratedSets should have a private __classcall__ method. Indeed most of the time, when inheriting from it, the family used in the union will be constructed in the __init__ method of the subclass. Having __classcall__ inherited force the user to have its own __classcall__.

There isn't yet any example of that in Sage but there are at least three of them comming in sage-combinat (trees, parking functions, Transitive groups). Dozens of them will follow along the cleanup of combinat.

However, as expected :-), there is already a counterexample (crystal). I took care of it. Due to the need of both behavior, I've written two small demo examples of this two use cases.

I also took the chance to fixe some typos in the doc.

Attachments (2)

trac_8524-disjoint_union_classcall_private-fh.patch (6.2 KB) - added by hivert 12 years ago.
Rebased against 4.3.4
trac_8524-disjoint_union_classcall_private-fh.2.patch (7.0 KB) - added by nthiery 12 years ago.
Replaces the previous ones

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by hivert

  • Description modified (diff)
  • Owner changed from sage-combinat to hivert

comment:2 Changed 12 years ago by hivert

  • Status changed from new to needs_review

The patch should be ready for review. I've one question: There is a very long doc in the class but nothing in the __init__ nor in the file itself. Any idea about what is best here ?


Changed 12 years ago by hivert

Rebased against 4.3.4

comment:3 Changed 12 years ago by hivert

  • Reviewers set to Nicolas M. Thiéry

I just rebased this patch against 4.3.4. Nicolas: Please don't forget reviewing it. It is needed by #8519 which is close to be positive reviewed.

Changed 12 years ago by nthiery

Replaces the previous ones

comment:4 Changed 12 years ago by nthiery

  • Cc sage-combinat added
  • Description modified (diff)

Positive review (finally!)

Florent: I made a couple little changes in place (mostly doc). Please re-proofread, and set the positive review status.

comment:5 Changed 12 years ago by hivert

  • Status changed from needs_review to positive_review

Your change are ok with me. Thanks for the review.

comment:6 Changed 12 years ago by jhpalmieri

  • Merged in set to sage-4.4.alpha1
  • Resolution set to fixed
  • Status changed from positive_review to closed

Merged "trac_8524-disjoint_union_classcall_private-fh.2.patch" into 4.4.alpha1.

Note: See TracTickets for help on using tickets.