support dunder variables #122
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#122
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?
(From M-Labs/nac3-spec#26)
Currently, dunder variables and methods (e.g.
self.__variable
) cannot be used in kernels as the compiler cannot find the attributes. I am not really sure how complex it would be to support that, but it could be a nice-to-have. Right now we sometimes need to make long variable/method names for base classes to make sure there is no name aliasing in sub-classes.https://docs.python.org/3/tutorial/classes.html#tut-private
Probably not too hard I guess.
sb10q referenced this issue2022-04-27 10:54:22 +08:00
May I ask for nac3artiq/src/codegen.rs. what info does the name field hold in this context? My intention is to access Python class name for the given symbol (after the symbol name querying when it's dunder)
And whether it could be as simple as accessing self.name for ArtiqCodeGenerator struct or it is best to be done dynamically from Python (by using timeline?) or even if it requires AST traversal