Skip to content

TrapezoidProfile signature includes default object repr for State #23

@auscompgeek

Description

@auscompgeek
Member

despite having a __repr__ implementation in the template_inline_code.

Activity

virtuald

virtuald commented on Feb 14, 2022

@virtuald
Member

Yeah, this is really interesting. On Linux:

from wpimath._controls._controls.trajectory import TrapezoidProfile

print(repr(TrapezoidProfile.State()))

Gives me:

LLVM ERROR: out of memory
Aborted (core dumped)

When I don't capture the clsName this goes away and the repr works fine, but it doesn't work correctly. Presumably because the repr isn't registered until after the default arguments are processed?

auscompgeek

auscompgeek commented on Feb 14, 2022

@auscompgeek
MemberAuthor

Oh, hmm. It does seem like the repr was quite broken. Could've sworn it worked last year. On macOS:

>>> from wpimath.trajectory import TrapezoidProfile
>>> TrapezoidProfile.State()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 0: invalid start byte
auscompgeek

auscompgeek commented on Feb 14, 2022

@auscompgeek
MemberAuthor

Presumably because the repr isn't registered until after the default arguments are processed?

I think this is what's happening, yeah. Need a way to add some code before all the methods are registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationpackage: wpimathsubprojects/robotpy-wpimath

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @auscompgeek@virtuald

        Issue actions

          TrapezoidProfile signature includes default object repr for State · Issue #23 · robotpy/mostrobotpy