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

Should constant values be included in stub files #502

Open
1 of 4 tasks
Josverl opened this issue Jan 26, 2024 · 0 comments
Open
1 of 4 tasks

Should constant values be included in stub files #502

Josverl opened this issue Jan 26, 2024 · 0 comments
Labels
enhancement New feature or request stubber MicroPython-stubber CLI

Comments

@Josverl
Copy link
Owner

Josverl commented Jan 26, 2024

Pro:

  • can be useful to help understand the interface

Con:

  • against recommendation, against PEP , slows down linters , type checkers
  • no tooling support ( all stubbers remove the values)

requested by @brianreinhold in https://github.com/orgs/micropython/discussions/13527

  • firmware stubber to capture both types and values in .pyi files.
    This eliminates a mypy.stubgen step - which removes all values
  • avoid overwriting value from frozen modules - need to merge rather than overwrite with frozen modules.
    There is a risk that this will obscure some classes or values that cannot be detected run-time
  • avoid needing to run mypy.stubgen in other steps,
    • or compensate for that by re-merging lost but relevant information in a 2nd step
@Josverl Josverl added the enhancement New feature or request label Jan 26, 2024
@Josverl Josverl added the stubber MicroPython-stubber CLI label Jun 25, 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 stubber MicroPython-stubber CLI
Projects
None yet
Development

No branches or pull requests

1 participant