Skip to content

[Flask-Cors] Update type annotation for origins to also allow Pattern#15825

Open
wvanbergen wants to merge 3 commits into
python:mainfrom
wvanbergen:wvanbergen/Flask-Cors
Open

[Flask-Cors] Update type annotation for origins to also allow Pattern#15825
wvanbergen wants to merge 3 commits into
python:mainfrom
wvanbergen:wvanbergen/Flask-Cors

Conversation

@wvanbergen

@wvanbergen wvanbergen commented May 23, 2026

Copy link
Copy Markdown

Small fix: this updates the type annotation for the origins argument for CORS() and CORS.init_app to also accept Patterns. Also, use Iterable rather than list to not cause compatibility issues.

@github-actions

This comment has been minimized.

@wvanbergen wvanbergen force-pushed the wvanbergen/Flask-Cors branch from ed1a6d6 to 555f3da Compare May 23, 2026 10:13
@github-actions

Copy link
Copy Markdown
Contributor

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

@brianschubert brianschubert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! See remarks below. This change looks good, but I'm noticing some inconsistencies with the previous annotations that we should fix while we're here.

Comment thread stubs/Flask-Cors/flask_cors/core.pyi Outdated
Comment thread stubs/Flask-Cors/flask_cors/extension.pyi Outdated
@wvanbergen

Copy link
Copy Markdown
Author

@brianschubert I double-checked your suggestions, and they all makes sense, so committed your suggestions. Thanks!

@wvanbergen wvanbergen force-pushed the wvanbergen/Flask-Cors branch from 6b907c1 to be55340 Compare June 8, 2026 18:29
@wvanbergen

Copy link
Copy Markdown
Author

Something weird happened with the mypy_primer run - seems like either something transient, or something unrelated to my changes, but I cannot retry failed runs.

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