Opened 10 years ago

Closed 10 years ago

#13801 closed defect (fixed)

Fix facade set category initialisation

Reported by: Vincent Delecroix Owned by: Vincent Delecroix
Priority: major Milestone: sage-5.8
Component: categories Keywords: category, facade, days45
Cc: Štěpán Starosta Merged in: sage-5.8.beta0
Authors: Vincent Delecroix Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Vincent Delecroix)

Facade sets are used in many places but there are two small errors that prevent from using it everywhere...

The first error concerns multiple categories initialisation. Here is a minimal example

class A(Parent):
    def __init__(self):
        Parent.__init__(self, 
            category=((FiniteEnumeratedSets(),Monoids()),
            facade=True)

for which we get

sage: A()
Traceback (most recent call last):
...
AttributeError: 'tuple' object has no attribute 'is_subcategory'

The second problem concerns the behavior of .facade_for() which is better explained with a minimal example

class B(Parent):
    def __init__(self):
        Parent.__init__(self, category=Sets(), facade=True)

for which we get

sage: b = B()
sage: b.facade_for()
Traceback (most recent call last):
...
AttributeError: 'B_with_category' object has no attribute '_facade_for'

The ticket provides the (trivial) corrections for both problems and add two doctests.

Attachments (1)

trac_13801-fix_facade_initialisation-vd.patch (3.0 KB) - added by Vincent Delecroix 10 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 10 years ago by Vincent Delecroix

Description: modified (diff)
Status: newneeds_review

comment:2 Changed 10 years ago by Sébastien Labbé

Note: you may use ReST syntax for citing trac ticket :

:trac:`12796`

comment:4 in reply to:  2 ; Changed 10 years ago by Vincent Delecroix

Replying to slabbe:

Note: you may use ReST syntax for citing trac ticket :

:trac:`12796`

That's now done.

comment:5 Changed 10 years ago by Vincent Delecroix

I modified the behavior of facade_for() in the way it was discussed on combinat-devel (see comment:3 of Travis).

Changed 10 years ago by Vincent Delecroix

comment:6 in reply to:  4 Changed 10 years ago by Vincent Delecroix

Replying to vdelecroix:

Replying to slabbe:

Note: you may use ReST syntax for citing trac ticket :

:trac:`12796`

That's now done.

Actually, I missed one and now it's done!

comment:7 Changed 10 years ago by Travis Scrimshaw

Keywords: days45 added
Reviewers: Travis Scrimshaw
Status: needs_reviewpositive_review

Looks good to me now. Thanks Vincent.

Travis

comment:8 Changed 10 years ago by Jeroen Demeyer

Milestone: sage-5.7sage-5.8
Resolution: fixed
Status: positive_reviewclosed

comment:9 Changed 10 years ago by Travis Scrimshaw

Was this merged in 5.7.rc0?

comment:10 Changed 10 years ago by Jeroen Demeyer

Resolution: fixed
Status: closednew

No.

comment:11 Changed 10 years ago by Jeroen Demeyer

Status: newneeds_review

comment:12 Changed 10 years ago by Jeroen Demeyer

Status: needs_reviewpositive_review

comment:13 Changed 10 years ago by Jeroen Demeyer

Merged in: sage-5.8.beta0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.