Skip to content
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 from __future__ import annotations in even more files; remove more quotes from annotations #13412

Merged
merged 3 commits into from Aug 15, 2022

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Aug 14, 2022

#13391 and #13407 missed a few spots ;)

Cc. @jhance / @cdce8p

@AlexWaygood AlexWaygood changed the title Add from __future__ import annotations in even more files; remove more quoted annotations Add from __future__ import annotations in even more files; remove more quotes from annotations Aug 14, 2022
@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Aug 14, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

cdce8p
cdce8p approved these changes Aug 14, 2022
Copy link
Contributor

@cdce8p cdce8p left a comment

Looks good AFAICT! Thanks for the follow up @AlexWaygood.
I left two small comments where I think a trailing comma could be useful.

mypy/nodes.py Show resolved Hide resolved
mypy/semanal_main.py Show resolved Hide resolved
@AlexWaygood
Copy link
Member Author

AlexWaygood commented Aug 14, 2022

Thanks for the review @cdce8p!

I left two small comments where I think a trailing comma could be useful.

I tried adding these, but black just strips them away again ;)

@cdce8p
Copy link
Contributor

cdce8p commented Aug 15, 2022

I left two small comments where I think a trailing comma could be useful.

I tried adding these, but black just strips them away again ;)

Found the issue

skip-magic-trailing-comma = true

The magic-trailing-comma isn't perfect but IMO it works well enough. I would recommend to remove that setting.
https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#the-magic-trailing-comma

@AlexWaygood
Copy link
Member Author

AlexWaygood commented Aug 15, 2022

Found the issue

skip-magic-trailing-comma = true

Good catch! I think it was @hauntsaninja that recommended enabling that setting in the initial refactor-for-black PR.

Whatever the wisdom of that setting, however, I'm not going to change that in this PR, since it's slightly tangential to this PR's purpose :-)

@hauntsaninja hauntsaninja merged commit 1d9ca64 into python:master Aug 15, 2022
18 checks passed
@AlexWaygood AlexWaygood deleted the future branch Aug 15, 2022
@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Aug 15, 2022

I don't like the magic trailing comma and I would not like that setting changed.

@cdce8p
Copy link
Contributor

cdce8p commented Aug 15, 2022

I don't like the magic trailing comma and I would not like that setting changed.

It might not be perfect but what I like about it is it at least gives you the option to choose a better formatting if it makes sense. I opened #13418 to show the impact of removing the option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants