Closed KotlinIsland closed 1 year ago
I'd be interested in adding annotations right into the code. I'd been using pycontracts as a pre-historic way of checking types, but that package is unmaintained and is causing pain.
If there are annotations, I want to run mypy, so we'd need some new tooling for that too.
Sounds cool, I'll give it a shot and make a PR, would you be interested in basedmypy?
While I'm here should I implement black?
That's generous of you, but I don't want black for this repo, thanks. I don't know anything about basedmypy, but I'm guessing I don't want that either, but maybe I'm wrong?
It's basically a fork of mypy with additional functionality. basedmypy:
def foo(a=1)
print(a)
mypy:
def foo(a: int = 1) -> None:
print(a)
For projects that use coverage
as a library (such as test runners), it would be better if the type annotations worked with standard mypy and didn’t require a custom fork.
I've started adding annotations. About 3/4 of the coverage/*.py files now check cleanly. Please let me know if I should do something differently.
@nedbat this is awesome! One outstanding task is to add a 'py.typed' file. See #1550
I would like some type stubs for coverage, I see that you support >= 3.7 so types in the code would be possible (although perhaps not desirable).
I'm happy to drive this. just need to know if you want the stubs inline or in a separate package, or maybe even hosted on typehsed.