Skip to content

properly implement __repr__ #401

Description

@repagh

The __repr__ methods should implement a representation that can be 'eval'-d back into the relevant object, so

>>> from control import TransferFunction
>>> s = TransferFunction.s
>>> h = 1/(s+1)
>>> print(repr(h))
TransferFunction([[array([1])]],[[array([1, 1])]],0)
>>> from numpy import array
>>> h2 = eval(repr(h))
>>> print(h2)

  1
-----
s + 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions