Skip to content

Conversation

@hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Mar 30, 2024

python/typing#1671

The narrowed types here are maybe a little sketchy / not sure how valuable this is

@github-actions

This comment has been minimized.

@hauntsaninja hauntsaninja marked this pull request as draft March 31, 2024 00:01
@github-actions

This comment has been minimized.

@hauntsaninja hauntsaninja changed the title Check no-op for reachability statements Check statements that are no-op for reachability Dec 27, 2024
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

aioredis (https://github.com/aio-libs/aioredis)
+ aioredis/client.py:4288: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]
+ aioredis/client.py:4291: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/type_util.py: note: In function "to_bytes":
+ lib/streamlit/type_util.py:164:26: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]

core (https://github.com/home-assistant/core)
+ homeassistant/helpers/template.py:719: error: Value of type "None" is not indexable  [index]

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.

1 participant