Skip to content

Support renaming of Functor (define _repr_(), not __repr__()) #16156

@pjbruin

Description

@pjbruin

The class Functor and some of its subclasses define a __repr__() method which doesn't support renaming:

sage: F=IdentityFunctor(Rings())
sage: F
The identity functor on Category of rings
sage: F.rename('I')
sage: F
The identity functor on Category of rings

This ticket moves these methods to _repr_() so the standard SageObject.__repr__() is used, which makes renaming work at least for Python classes.

Component: categories

Keywords: repr renaming

Author: Peter Bruin

Branch/Commit: 4866cae

Reviewer: Jan Keitel

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions