errors for flask.Blueprint definitions with pyright 1.1.395 #9999
Unanswered
matt-the-midnight-hacker
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Your question is a reasonable one. I've started a discussion in the Python typing forum to get feedback from the broader typing community. Feel free to join in on that discussion if you have an opinion. Regardless of how the discussion pans out, the above snippet is clearly a bug in the library code. I recommend that you report it to the library maintainer. Adding a |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi I just updated pyright and I now get in my flask view modules errors reported.
My code looks like
blueprint = flask.Blueprint("my_view", __name__)
and pyright finds:
error: Argument of type "object" cannot be assigned to parameter "cli_group" of type "str | None" in function "__init__"
Note that I do not assign "cli_group". Actually just the default value should get used.
It might be correct that there is something wrong with the assignment in the flask blueprint module but since it is not on my
code there is not much I can do about that other then assigning a value. But since I just want the default behavior I'd prefer not to set it everywhere.
Should pyright really report an error on my module if the actual issue happens in
flask/blueprints.py
?The flask code in question looks like this btw.
Beta Was this translation helpful? Give feedback.
All reactions