Open mathbunnyru opened 2 years ago
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. Could you submit a patch for this?
There are other alternatives for task definition: see #35. I am also working on one alternative with integration with click...
By the way, you know you can get quick documentation on command line with
$ doit help task
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. Could you submit a patch for this?
There are other alternatives for task definition: see #35. I am also working on one alternative with integration with click...
Yes, dataclasses are great 👍 I think I will be a bit busy for the next couple of months :( But, if I have some time, I will try to take a closer look at this project (I've only started using it yesterday).
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 havedataclass
,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.