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

Add typing stubs for commonly used Cython classes, structures, methods and important attributes #646

Closed
wants to merge 7 commits into from

Conversation

JMPZ11
Copy link
Contributor

@JMPZ11 JMPZ11 commented Jun 21, 2022

These stubs provide typing support for CANParser and CANDefine. Stubs do not impact the runtime behavior, but they provide the opportunity for type validation, dramatically simplify the development process and also aid dramatically in trying to understand the code.

Cython / CPython files, or even headers are not parsed by common type inferencing engines (like PyLance), causing them to show up as un-typed in editors like VSCode. The type hints allow not only presenting the objects as though they were first-class python objects, but docstrings can be added to aid developers in using the classes.

Remaining Tasks:

  • Determine the appropriate python type to use for SignalValue.value (also the vl dicts)
  • Implement remaining classes / data structures that are commonly used

@adeebshihadeh
Copy link
Contributor

Merged everything except the pyi files in #774. I support the intent behind them, but maintaining a separate file for them isn't worth it in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants