Skip to content

Use PEP 585 syntax in @python2/_ast, convert more TypeVars to _typeshed.Self, & # noqa a SQLAlchemy line - #6954

Merged
JelleZijlstra merged 2 commits into
python:masterfrom
AlexWaygood:python2-fixes
Jan 18, 2022
Merged

JelleZijlstra merged 2 commits into
python:masterfrom
AlexWaygood:python2-fixes

Conversation

@AlexWaygood

Copy link
Copy Markdown
Member

Part II of trying to get the CI green for PyCQA/flake8-pyi#97

@github-actions

Copy link
Copy Markdown
Contributor

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

@JelleZijlstra
JelleZijlstra merged commit cd93461 into python:master Jan 18, 2022
@AlexWaygood
AlexWaygood deleted the python2-fixes branch January 18, 2022 19:27
@hauntsaninja

Copy link
Copy Markdown
Collaborator

Does this definitely work? I.e. why did we skip Python 2 when we did this codemod previously?

@hauntsaninja

Copy link
Copy Markdown
Collaborator

#5872 just says "scripts did something weird", but looks like we switched Python 2 to use PEP 604 syntax in #5915 and nothing went wrong :-)

@AlexWaygood

AlexWaygood commented Jan 18, 2022

Copy link
Copy Markdown
Member Author

Does this definitely work? I.e. why did we skip Python 2 when we did this codemod previously?

From my perspective, it was because I didn't care about Python 2 stubs, and there would be fewer problems to fix after the script had run if I only ran the script on the Python-3-only stub :)

@Akuli

Akuli commented Jan 18, 2022

Copy link
Copy Markdown
Collaborator

I wrote "e.g. because scripts did something weird", and this particular reason isn't why I skipped @python2 stubs. I didn't touch @python2 simply because I don't care about what happens to Python 2 stubs.

Also, AlexWaygood's scripts tend to be of much better quality than my quick and dirty scripts, so they're less likely to ruin stub files and require manual work :)

@Akuli

Akuli commented Jan 18, 2022

Copy link
Copy Markdown
Collaborator

Another note: flake8-pyi uses typeshed's .flake8 file in its CI, so configuring flake8 to silence @python2 errors there is also an 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.

4 participants