Skip to content

Make it easier to customize pexpect interfaces #22501

@simon-king-jena

Description

@simon-king-jena

While working on #22452, I found a couple of issues that might be dealt with in a separate ticket.

  • The pexpect interfaces and the interface elements inherit from Parent resp. from Element. But they override __repr__, which is bad. So, I change __repr__ into single underscore methods in all interfaces.

  • The default implementation of _true_symbol and some others rely on the assumption the self.eval(...) returns a string representation when applied to an integer or bool. But this assumption is violated for Polymake. However, self.get(...) is supposed to return a string representation for everything. I am stating these specifications in the doc and replace eval with get where needed.

  • For interface elements, I replace self.parent() by self._check_valid() in a couple of places, since that returns the parent after testing that it is still valid.

  • In the string representation of an interface element of a crashed interface, I show the crash message, so that it becomes a bit clearer what has happened.

Component: interfaces

Keywords: pexpect, days84

Author: Simon King

Branch/Commit: 52226e2

Reviewer: Jeroen Demeyer, Vincent Delecroix

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions