Update syntax for existing type annotations#5298
Update syntax for existing type annotations#5298kushaldas merged 2 commits intofreedomofpress:developfrom
Conversation
|
This pull request introduces 1 alert when merging b1f28a5 into e300a6e - view on LGTM.com new alerts:
|
b1f28a5 to
f4647f5
Compare
Uses syntax described in PEP484.
f4647f5 to
a5218db
Compare
|
Not sure what's holding up CI here... |
|
After digging more into this I think Even after I bring in all the imports into the main code from the Related similar issues:
We should discuss about this during the standup tonight. @pierwill Please hold of any future PR like this until we figure out a way. Otherwise |
|
It makes sense to migrate away from type comments now that we're on Python 3. To address the lint failures we have the following options:
I think option 5 makes the most sense. We can revert this when pylint-dev/pylint#3285 is addressed upstream. See commit d3707e6 which does this on top of this PR and has a passing lint target. Let me know what you think @kushaldas @pierwill ! |
Let us go with 5. We will revert back when |
|
Counterpoint: we're not even using pylint on our other projects, just flake8, which evidently doesn't have these problems with type annotations. I think it'd be worth reevaluating whether we really need both, instead of letting one linter's shortcomings dictate a different style of annotation to what we're using everywhere else. |
kushaldas
left a comment
There was a problem hiding this comment.
@pierwill thank you for the work. Now you can finish off the rest of the changes following @redshiftzero.
|
Hmm fair, I'll file an issue for considering pylint removal, when testing this branch I did find more linting issues in pylint compared to flake8 (worth investigating what the difference is). However, we'll still get F821 lint failures even with flake8 only due to our use of |
Status
Ready for review
Description of Changes
Update syntax for existing type annotations.
Should fix #5282.