Skip to content

Let the TestSuite test that the construction of a parent returns the parent #15223

@simon-king-jena

Description

@simon-king-jena

Andrey told me about the following problem. When he implemented toric lattices, he inherited a .construction() method from general lattices. Consequence: If he tried to add elements of two different toric lattices, then Sage applied a pushout construction and added the two elements after pushing them to ZZ^2, which was not what he wanted.

His solution was, I think, the correct one: He overloaded the .construction() method, so that it now returns None.

Update: A similar problem also showed up in #30360.

Suggestion: Introduce a test of the TestSuite of a parent P, that will complain if P.construction() returns a pair F, O such that F(O)!=P.

I think this test should be put into sage.structure.parent.Parent (Update 9.2: sage.categories.sets_cat), because this is where .construction() is defined in the first place.

CC: @novoselt @nthiery @sagetrac-sage-combinat @tscrim @fchapoton @mwageringel @kwankyu @dkrenn

Component: coercion

Keywords: construction functor, test suite, sd53

Author: Simon King, Matthias Koeppe, Marc Mezzarobba, Travis Scrimshaw

Branch: 29e2ce0

Reviewer: Travis Scrimshaw, Matthias Koeppe

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions