classes without __init__ should be valid #221
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#221
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
expected output: 1
wylited referenced this issue2022-04-13 10:57:30 +08:00
Actually we won't be able to differentiate between the case which the constructor exists but does not have
@kernel
/@portable
from the case which the constructor does not exist at all. This is due to how we handle kernel/portable declaration (filtering in nac3artiq).The solution seems pretty straightforward to me: add a boolean flag in nac3core that determines whether to accept creation of classes without an explicit
__init__
.nac3standalone would set the flag and creation of such classes would succeed.
nac3artiq would not set it, and the user needs to define
__init__
and decorate it with@kernel
or@portable
for nac3core to see it and allow the creation of the class.We need to do the right thing if the user mistakenly decorates
__init__
with@rpc
.what is "the right thing"? throwing an error?
Yes, with a user-friendly message.