Alex Waygood
Alex Waygood
I assume you're suggesting that we carve out a very narrow exception for the case of class-literal-vs-`type[]` `assert_type` calls? I assume you would _not_ want, for example, `assert_type(True, int)` to...
FWIW, in typeshed where we have a test that only fails on pyright, we use `# pyright: ignore` on that line. And we have a configuration that means that pyright...
Yeah, totally agree it's annoying -- I wish we didn't have to do it in typeshed either! But I do feel like the better solution here is to push for...
Maybe if we infer a non-spellable subtype of the type you're asserting, we could emit a diagnostic with a different error code (which would have warn-level by default, rather than...
IDK. To me it seems almost inevitable that we'd get a bug report complaining about inconsistent behaviour if an `assert_type` call passes but `reveal_type` says something very different 🤷 Maybe...
Yes, this was fixed in https://github.com/astral-sh/ruff/pull/20974
Thanks so much @Wauplin!!
> Pyrefly seems to be the only type checker that accepts this but I'm not sure why (I'm not a typing expert myself). All other type checkers (Pyright, mypy) reject...
@carljm thanks -- agreed! This is indeed unsound: ```pycon % python Python 3.13.1 (main, Jan 3 2025, 12:04:03) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin Type "help", "copyright", "credits" or "license" for...
Thanks for the report! Mypy and pyright both apply special handling for this decorator, which monkey-patches methods onto a class in a similar way to the `@dataclass` decorator. We'll need...