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

Improve type annotations in Flask-Cors stubs #12596

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Conversation

ashm-dev
Copy link
Contributor

@srittau As promised, I have added the constants.

This comment has been minimized.

RegexObject: type[Pattern[str]]
DEFAULT_OPTIONS: _Options

ACL_ORIGIN: Final[str] = "Access-Control-Allow-Origin"
Copy link
Collaborator

@srittau srittau Aug 26, 2024

Choose a reason for hiding this comment

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

Nit: If you have a default, you don't need to specify the type:

ACL_ORIGIN: Final = "Access-Control-Allow-Origin"

(Here and below.)

We should really have a flake8 warning for that. I filed PyCQA/flake8-pyi#499.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, everything will be fine now!

Copy link
Contributor

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

@ashm-dev ashm-dev requested a review from srittau August 27, 2024 08:01
Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks!

@srittau srittau merged commit f58dac1 into python:main Aug 27, 2024
48 checks passed
@ashm-dev ashm-dev deleted the flask-cors branch August 27, 2024 08:48
max-muoto pushed a commit to max-muoto/typeshed that referenced this pull request Sep 8, 2024
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.

2 participants