| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
This should be another 2.5% on self check
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Sorry, something went wrong.
There was a problem hiding this comment.
Nice, I guess this helps with third-party libraries a lot.
Sorry, something went wrong.
|
This change causes a few regressions for Home Assistant. homeassistant/data_entry_flow.py:361: error: Incompatible types in assignment (expression has type "Invalid | list[Any]", variable has type "list[Invalid]") [assignment] homeassistant/config.py:529: error: Item "Invalid" of "Invalid | list[Any]" has no attribute "__iter__" (not iterable) [union-attr] homeassistant/components/hassio/ingress.py:194: error: Too many arguments for "must_be_empty_body" [call-arg] homeassistant/components/hassio/ingress.py:194: error: Need type annotation for "empty_body" [var-annotated] homeassistant/components/hassio/ingress.py:194: error: Argument 1 to "must_be_empty_body" has incompatible type "str"; expected "Callable[..., Never]" [arg-type] homeassistant/components/jewish_calendar/services.py:73: error: Argument "date" to "Omer" has incompatible type "_lru_cache_wrapper[Any]"; expected "HebrewDate | None" [arg-type] homeassistant/components/amberelectric/coordinator.py:85: error: Call to untyped function "get_current_prices" of "AmberApi" in typed context [no-untyped-call] homeassistant/components/amberelectric/config_flow.py:68: error: Call to untyped function "get_sites" of "AmberApi" in typed context [no-untyped-call] homeassistant/components/knx/storage/entity_store_validation.py:53: error: Item "Invalid" of "Invalid | list[Any]" has no attribute "__iter__" (not iterable) [union-attr] As an example, one can be narrowed down to # pip install voluptuous==0.16.0
import voluptuous as vol
def f(ex: vol.MultipleInvalid):
reveal_type(ex.errors)This should be inferred as builtins.list[voluptuous.error.Invalid] but after this change it's voluptuous.error.Invalid | builtins.list[Any]. The classes are basically defined as: class Invalid(Exception): ...
class MultipleInvalid(Invalid):
def __init__(self, errors: list[Invalid] | None = None) -> None:
self.errors = errors[:] if errors else []However, with that ex.errors would be inferred correctly again. -- |
Sorry, something went wrong.
|
Ah, I see the issue. This is why I had the "pure" renames in the first PR. I'll revert and think about if there's a good way to be systematic about this. Thanks for bringing it up! |
Sorry, something went wrong.
This reverts commit 195ab98.
These would have caught the issue with #20696 by testing code paths where removing diagnostics affects checking Co-authored by Codex
| Back | FazBrowse Home | New Git URL |
This should be another 2.5% on self check
Sequel to #20621