unable to annotate tuple return type of extern function #81

Closed
opened 2021-11-10 13:47:19 +08:00 by sb10q · 2 comments
@extern
def rtio_input_timestamped_data(timeout_mu: int64,
                                channel: int32) -> Tuple[int64, int32]:
    """Wait for an input event up to timeout_mu on the given channel, and
    return a tuple of timestamp and attached data, or (-1, 0) if the timeout is
    reached."""
    raise NotImplementedError("syscall not simulated")
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "unknown class name"', nac3artiq/src/lib.rs:378:44

Also we should have a better error message for this.

``` @extern def rtio_input_timestamped_data(timeout_mu: int64, channel: int32) -> Tuple[int64, int32]: """Wait for an input event up to timeout_mu on the given channel, and return a tuple of timestamp and attached data, or (-1, 0) if the timeout is reached.""" raise NotImplementedError("syscall not simulated") ``` ``` thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "unknown class name"', nac3artiq/src/lib.rs:378:44 ``` Also we should have a better error message for this.

No, the problem is that we do not support Tuple, use tuple instead. Error message is indeed a problem.

No, the problem is that we do not support `Tuple`, use `tuple` instead. Error message is indeed a problem.
Poster
Owner

OK. I see typing.Tuple is also deprecated.

OK. I see ``typing.Tuple`` is also deprecated.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#81
There is no content yet.