-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
This comment has been minimized.
This comment has been minimized.
stubs/Flask-Cors/flask_cors/core.pyi
Outdated
RegexObject: type[Pattern[str]] | ||
DEFAULT_OPTIONS: _Options | ||
|
||
ACL_ORIGIN: Final[str] = "Access-Control-Allow-Origin" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@srittau As promised, I have added the constants.