Skip to content

Reenable flake8-pyi's Y011 and Y015 #9551

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

Merged
merged 3 commits into from
Jan 16, 2023
Merged

Reenable flake8-pyi's Y011 and Y015 #9551

merged 3 commits into from
Jan 16, 2023

Conversation

AlexWaygood
Copy link
Member

Cc. @Avasam for PyScreeze and pywin32; cc. @hmc-cs-mdrissi for TensorFlow.

Following the new release of flake8-pyi, default values for parameters are allowed in many situations. The new rules are that default values are allowed if the default value is an int, a float, a complex number, a string, a bytes object, a bool, None, or ....

For other default values, we'll continue to use .... This has two advantages:

  • It keeps stubs concise and readable.
  • It means that stubtest will be easily able to verify any default values that we do include in the stubs, something which it might struggle with if we were to include more complex default values.

@github-actions
Copy link
Contributor

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

Copy link
Contributor

@hmc-cs-mdrissi hmc-cs-mdrissi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tensorflow side looks good to me. I'll miss enums a bit, but I can see understanding enums would likely be too complex for a static checker like flake8-pyi

@AlexWaygood AlexWaygood merged commit 2b9f200 into main Jan 16, 2023
@AlexWaygood AlexWaygood deleted the reenable branch January 16, 2023 22:52
@Avasam
Copy link
Collaborator

Avasam commented Jan 17, 2023

Awesome. I was waiting for this to be fully supported to update the stubs I contributed and use.

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