Opened 14 years ago

Closed 14 years ago

Last modified 6 years ago

#5979 closed defect (fixed)

[with patch, positive review] Parent: fixes broken (implicit) invariant between ._element_constructor and self._element_init_pass_parent

Reported by: Nicolas M. Thiéry Owned by: Nicolas M. Thiéry
Priority: major Milestone: sage-4.0.1
Component: coercion Keywords: coercion, parents, element_constructor
Cc: Sage Combinat CC user Merged in: 4.0.1.alpha0
Authors: Nicolas M. Thiéry Reviewers: Robert Bradshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Frédéric Chapoton)

In Parent, there is a (previously implicit) invariant, namely that:

self._element_init_pass_parent == guess_pass_parent(between ._element_constructor)

This invariant was broken when self._element_constructor was set from self._element_constructor_ by call. This made the parent not to be passed properly to _element_constructor.

This patch fixes this (one line), and adds a corresponding doctest. It also includes a related trivial fix to a line that is apparently never used in coerce_maps, and adds a comment about this.

The category patch #5891 depends heavily on this one, as this way of setting _element_constructor becomes the default one for simple parents.

Attachments (1)

parent-element_constructor-fix-5979-submitted.patch (4.1 KB) - added by Nicolas M. Thiéry 14 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 14 years ago by Nicolas M. Thiéry

Description: modified (diff)

Changed 14 years ago by Nicolas M. Thiéry

comment:2 Changed 14 years ago by Nicolas M. Thiéry

Summary: Parent: fixes broken (implicit) invariant between ._element_constructor and self._element_init_pass_parent[with patch, needs review] Parent: fixes broken (implicit) invariant between ._element_constructor and self._element_init_pass_parent

comment:3 Changed 14 years ago by Nicolas M. Thiéry

I should mention that sage -testall passes smoothly with sage-3.4.2-alpha0 (except for a trivial broken test in interfaces.r which also fails before applying the patch). Haven't tried it with sage-3.4.2 final (under compilation)

comment:4 Changed 14 years ago by Nicolas M. Thiéry

Description: modified (diff)

comment:5 Changed 14 years ago by Nicolas M. Thiéry

Status: newassigned

comment:6 Changed 14 years ago by Robert Bradshaw

Summary: [with patch, needs review] Parent: fixes broken (implicit) invariant between ._element_constructor and self._element_init_pass_parent[with patch, positive review] Parent: fixes broken (implicit) invariant between ._element_constructor and self._element_init_pass_parent

comment:7 Changed 14 years ago by Mike Hansen

Resolution: fixed
Status: assignedclosed

Merged in 4.0.1.alpha0.

comment:8 Changed 13 years ago by Mike Hansen

Authors: Nicolas Thiery
Merged in: 4.0.1.alpha0
Reviewers: Robert Bradshaw

comment:9 Changed 7 years ago by Frédéric Chapoton

Description: modified (diff)
Report Upstream: N/A

comment:10 Changed 6 years ago by Frédéric Chapoton

Authors: Nicolas ThieryNicolas M. Thiéry
Note: See TracTickets for help on using tickets.