You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting a different error in Python 3.11 that I think is caused by the same thing.
If I try to access anything that ResultList has but Dict[str, Any] doesn't, Pylance gets angry.
Cannot access member "total" for type "Dict[str, Any]"
Member "total" is unknown
Argument of type "Literal[0]" cannot be assigned to parameter "__key" of type "str" in function "__getitem__"
"Literal[0]" is incompatible with "str"
And if I try say that the return from search_issues is explicitly ResultList during variable assignment, I get this:
Expression of type "Dict[str, Any] | ResultList[Issue]" cannot be assigned to declared type "ResultList[Unknown]"
Type "Dict[str, Any] | ResultList[Issue]" cannot be assigned to type "ResultList[Unknown]"
"Dict[str, Any]" is incompatible with "ResultList[Unknown]"
or for ResultList[Issue]:
Expression of type "Dict[str, Any] | ResultList[Issue]" cannot be assigned to declared type "ResultList[Issue]"
Type "Dict[str, Any] | ResultList[Issue]" cannot be assigned to type "ResultList[Issue]"
"Dict[str, Any]" is incompatible with "ResultList[Issue]"
So in order to quiet the errors I have to explicitly say:
Bug summary
Using
Gives the aforementioned result:
The culprit seems to be:
which should be quickly solveable with a little bit of https://mypy.readthedocs.io/en/stable/more_types.html#function-overloading
Is there an existing issue for this?
Jira Instance type
Jira Cloud (Hosted by Atlassian)
Jira instance version
No response
jira-python version
3.4.1
Python Interpreter version
3.9
Which operating systems have you used?
Reproduction steps
Stack trace
-
Expected behaviour
No typing issues
Additional Context
No response
The text was updated successfully, but these errors were encountered: