-
Notifications
You must be signed in to change notification settings - Fork 18
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 static typing #35
Comments
I think it would be great to add something like the following type import typing as t
from typing_extensions import TypedDict # only available in typing from py3.8+
class Config(TypedDict):
id: t.Optional[str]
entry: ...
exit: ...
states: ...
on: ...
type: ...
data: ...
onDone: ...
initial: ... Then you get auto complete suggestions when using the config object and IDE's should warn you if you try to make a config that isn't valid. What python versions do we wish to support? No need for |
We probably want to support 3.x versions of Python (whatever this cut-off is), since I imagine the majority of Python devs are still on an older version. |
To get improved auto suggestions when creating They prioritise by upvotes so if you want better autocomplete for XState in python then please give it a vote. |
Pyright released a new version that enables autocomplete for See this for details; microsoft/pylance-release#654 and this: https://github.com/microsoft/pylance-release/releases/tag/2021.9.4 |
This is a task originally made for PR #34 but I decided to make it into its own issue instead, since it will take some effort to do proper typing in the package.
poetry run mypy -p xstate
runs without errors.github/workflows/pull_request.yaml
in the code quality sectionThe text was updated successfully, but these errors were encountered: