-
-
Notifications
You must be signed in to change notification settings - Fork 171
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 type annotations to doit #420
Comments
yes. I plan to add mypy annotations. I was thinking about adding a dataclass to be used as an alternative to plain metadata in dictionary for IDE folks. There are other alternatives for task definition: see #35. |
By the way, you know you can get quick documentation on command line with
|
Yes, dataclasses are great 👍 |
An alternative to dataclass is TypedDict. |
Right now every task looks more-or-less like this:
It would be so nice if we actually had a type-annotated class
Task
withactions
andtargets
fields.Right now, every Task is basically dict.
I think, it was a great decision back in the days, but right now we have
dataclass
,typing
module and they work so great for modern code.Having type annotations in python makes programming much easier:
mypy
(python static linter) will catch thatdoit
Unfortunately, adding type annotations to an existing project is not the easiest and the most funny thing to do, but it has lots of benefits.
The text was updated successfully, but these errors were encountered: