#5979: [with patch, positive review] Parent: fixes broken (implicit) invariant
between ._element_constructor and self._element_init_pass_parent
-------------------------------------------------+-------------------------
       Reporter:  nthiery                        |        Owner:  nthiery
           Type:  defect                         |       Status:  closed
       Priority:  major                          |    Milestone:
      Component:  coercion                       |  sage-4.0.1
       Keywords:  coercion, parents,             |   Resolution:  fixed
  element_constructor                            |    Merged in:
        Authors:  Nicolas Thiery                 |  4.0.1.alpha0
Report Upstream:  N/A                            |    Reviewers:  Robert
         Branch:                                 |  Bradshaw
   Dependencies:                                 |  Work issues:
                                                 |       Commit:
                                                 |     Stopgaps:
-------------------------------------------------+-------------------------
Changes (by chapoton):

 * upstream:   => N/A


Old description:

> 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.

New description:

 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.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/5979#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to