error "not a valid type annotation" masks other errors #198

Closed
opened 2022-02-25 18:08:46 +08:00 by sb10q · 1 comment
from artiq.coredevice.sampler import Sampler

alone fails with an understandable error:

type error at identifier `ValueError` (cannot find symbol `ValueError`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 36 column 15

But if you follow it with:

@nac3
class NAC3Devices(EnvExperiment):
    sampler0: KernelInvariant[Sampler]

then the original error disappears and is replaced with something opaque:

`Sampler` is not a valid type annotation (at nac3devices.py: line 19 column 31)
``` from artiq.coredevice.sampler import Sampler ``` alone fails with an understandable error: ``` type error at identifier `ValueError` (cannot find symbol `ValueError`) at /home/sb/artiq/artiq/coredevice/sampler.py: line 36 column 15 ``` But if you follow it with: ``` @nac3 class NAC3Devices(EnvExperiment): sampler0: KernelInvariant[Sampler] ``` then the original error disappears and is replaced with something opaque: ``` `Sampler` is not a valid type annotation (at nac3devices.py: line 19 column 31) ```
sb10q added this to the Prealpha milestone 2022-02-25 18:08:46 +08:00
sb10q added the
high-priority
label 2022-02-25 18:08:46 +08:00
pca006132 was assigned by sb10q 2022-02-25 18:08:46 +08:00
Poster
Owner

Nevermind - @nac3 was missing on Sampler, so the "not a valid type annotation" error is actually reasonable, though still slightly confusing.

Nevermind - ``@nac3`` was missing on ``Sampler``, so the "not a valid type annotation" error is actually reasonable, though still slightly confusing.
sb10q closed this issue 2022-02-25 18:11:01 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
1 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#198
There is no content yet.