-
Notifications
You must be signed in to change notification settings - Fork 1
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
Typing Examples #15
Comments
What would this change from the existing request dictionary? |
We may need to make some small changes from the And also, it would be nice to set up MyPy to have a proper check. After that, we can change the examples and docs to show explicitly to the user which are the parameter types, like the example above. params: CreateScheduleRequest = { ... |
mypyit would be nice to have all sorts of checkers in mypy
[mypy]
; Ensure full coverage
disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
disallow_untyped_decorators = True
check_untyped_defs = True
; Restrict dynamic typing
disallow_any_generics = True
disallow_subclassing_any = True
warn_return_any = True
; Know exactly what you're doing
warn_redundant_casts = True
warn_unused_ignores = True
warn_unused_configs = True
warn_unreachable = True
show_error_codes = True
; Explicit is better than implicit
no_implicit_optional = True with that, we are going to have ~168 issues. but definitely, it can be done progressively, incrementing each checker at a time |
adding: fixing all these types of issues we can mark the package as "typed" using the |
Proposal
Hey there, do we want to use type hints in rows for types?
Example:
So, by doing that
params: CreateScheduleRequest
we can give a really good experience to the user and he can make sure is passing the right params to the method.Also, he can have a quick check with the VSCode autocomplete feature.
And see if some key is optional or required as well.
If we want to do it, I can work on that 😄
The text was updated successfully, but these errors were encountered: