Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve module registers declaration to enable type checking #15

Open
kingofpayne opened this issue Feb 6, 2024 · 0 comments
Open

Improve module registers declaration to enable type checking #15

kingofpayne opened this issue Feb 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@kingofpayne
Copy link
Contributor

Currently the registers of classes inheriting from scaffold.Module are populated using the method Module.add_register. This method automatically adds attributes to the modules with the register name (prefixed with "reg_").

Python code analysers, for example type inference plugins or autocompletion, fail to understand that.
Instead of writing:

self.add_register("status", "rw", address)

We could write :

self.reg_status = add_register("rw", address)

@kingofpayne kingofpayne added the enhancement New feature or request label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant