Skip to content

Parent: fixes broken (implicit) invariant between ._element_constructor and self._element_init_pass_parent #5979

@nthiery

Description

@nthiery

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.

CC: @sagetrac-sage-combinat

Component: coercion

Keywords: parents, element_constructor

Author: Nicolas M. Thiéry

Reviewer: Robert Bradshaw

Merged: 4.0.1.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/5979

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions