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

Type improvements #41

Merged
merged 12 commits into from
Nov 28, 2023
Merged

Type improvements #41

merged 12 commits into from
Nov 28, 2023

Conversation

ytkimirti
Copy link
Collaborator

@ytkimirti ytkimirti commented Nov 23, 2023

I changed some from Dict to Mapping since

mytype = Dict[str, str]

def fn(arg: Dict[str, Union[str, int]]):
    pass

fn(key_value_pairs)

this gives

Argument of type "dict[str, str]" cannot be assigned to parameter "arg" of type "Dict[str, str | int]" in function "fn"
"dict[str, str]" is incompatible with "Dict[str, str | int]"
Type parameter "_VT@dict" is invariant, but "str" is not the same as "str | int"
Consider switching from "dict" to "Mapping" which is covariant in the value typePylancereportGeneralTypeIssues

upstash_redis/typing.py Outdated Show resolved Hide resolved
upstash_redis/asyncio/client.py Show resolved Hide resolved
upstash_redis/http.py Show resolved Hide resolved
upstash_redis/typing.py Outdated Show resolved Hide resolved
upstash_redis/utils.py Outdated Show resolved Hide resolved
@ytkimirti ytkimirti merged commit a1a8851 into main Nov 28, 2023
1 check passed
@mdumandag mdumandag deleted the type-changes branch November 28, 2023 10:36
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.

None yet

2 participants