pylint
pylint copied to clipboard
Expose types
Type of Changes
| Type | |
|---|---|
| ✓ | :sparkles: New feature |
Description
Closes #5488
We have #2079 to track further "high-hanging fruit" missing type annotations, but the most important ones are done, so let's expose them finally.
Edit by @DanielNoord: This can now also close #2079 as the typing is now (almost) complete
Pull Request Test Coverage Report for Build 2605232781
- 0 of 0 changed or added relevant lines in 0 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 95.358%
| Totals | |
|---|---|
| Change from base Build 2601041076: | 0.0% |
| Covered Lines: | 16702 |
| Relevant Lines: | 17515 |
💛 - Coveralls
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉
This comment was generated for commit 237711daefbc4505f9743839ebbdb361f769bb08
I'm not sure if we should do this. As long as astroid can't pass mypy I'm not truly comfortable that all of our typing is correct. Might be better to wait until that has been finished?
I'm not sure if we should do this. As long as astroid can't pass mypy I'm not truly comfortable that all of our typing is correct. Might be better to wait until that has been finished?
I hear that, but it's correct for the current version, right? If future versions of astroid change, then future versions of pylint change, but that's not an issue for people developing against the current version of pylint.
I hear that, but it's correct for the current version, right? If future versions of
astroidchange, then future versions ofpylintchange, but that's not an issue for people developing against the current version of pylint.
Well, we think the typing is correct. But, to give an example, we also run into the issue described in https://github.com/PyCQA/astroid/issues/1680 in pylint as we use it at least once. By adding py.typed we signal that we think that our current typing is at least correct and can only be expanded to include additional signatures, but I wouldn't be 100% that it is actually correct.
Sorry I approved without giving my reasonning. I thought that astroid had to be typed before pylint too, but there's some level of separation between pylint and astroid, and most pylint API do not expose astroid's API, so it's probably correct enough and useful enough. Also we'll get issue for the part that are used, maybe even contributions.
By adding py.typed we signal that we think that our current typing is at least correct and can only be expanded to include additional signatures, but I wouldn't be 100% that it is actually correct.
Until you mentioned PyCQA/astroid#1680 I would have said we are confident that it is correct given current state of astroid, which is all we can ever promise. (Even if we know astroid will keep changing.) But PyCQA/astroid#1680 is a good point -- we know that's wrong. So I'm happy to postpone this.
Don't forget to add the py.typed to the pylint entry for tool.setuptools.package-data in pyproject.toml
Superseded by https://github.com/PyCQA/pylint/pull/8402