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

Don't accidentally ignore typeguard validity for staticmethods #14953

Merged
merged 10 commits into from
Mar 26, 2023

Conversation

A5rocks
Copy link
Contributor

@A5rocks A5rocks commented Mar 24, 2023

I was checking through my previous contributions and noticed I messed up the logic here. I added a test case that currently is wrong.

Followup to #14238

I haven't run this on my own machine (it's a one line change....) but presumably CI will pass!

@A5rocks
Copy link
Contributor Author

A5rocks commented Mar 24, 2023

Apologies for the commit spam, I was trying out the github.dev editor (which doesn't actually run anything...) as I thought this would be a trivial change xd

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@A5rocks
Copy link
Contributor Author

A5rocks commented Mar 24, 2023

:/

Why does the line referenced depend on Python version...

@AlexWaygood
Copy link
Member

AlexWaygood commented Mar 24, 2023

:/

Why does the line referenced depend on Python version...

Possibly because we use typed-ast on 3.7 for parsing Python source files, but the stdlib ast module on 3.8? (Just a hunch, I haven't verified that that's the cause.) It could also be a change in the grammar between the two Python versions.

@A5rocks
Copy link
Contributor Author

A5rocks commented Mar 24, 2023

Huh, didn't realize we parsed with different parsers like that. I'm not sure why Python nightly passes though.

@AlexWaygood
Copy link
Member

AlexWaygood commented Mar 24, 2023

Huh, didn't realize we parsed with different parsers like that.

Yeah, prior to 3.8, type comments weren't parsed by the stdlib ast module, but on 3.8+ they are.

I'm not sure why Python nightly passes though.

We mark the nightly run as a success even if the tests fail ;)

- name: Mark as a success

If you click the "details" button, you'll see that many tests currently fail on 3.12. I presume most of these are due to mypyc incompatibilities with changes made to the CPython interpreter that have yet to be released (haven't looked at them in depth/at all).

@github-actions

This comment has been minimized.

@hauntsaninja
Copy link
Collaborator

Thank you! :-)

@github-actions

This comment has been minimized.

@AlexWaygood AlexWaygood added the topic-typeguard TypeGuard / PEP 647 label Mar 25, 2023
@github-actions
Copy link
Contributor

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

@hauntsaninja hauntsaninja merged commit c170056 into python:master Mar 26, 2023
@A5rocks A5rocks deleted the stop-ignoring-staticmethods branch March 26, 2023 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-typeguard TypeGuard / PEP 647
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants