Carl Meyer

Results 478 comments of Carl Meyer

I do think this approach is plausible. Those `linter_no_panic` tests are quite aggressive stress tests of stub file handling, in that they take regular (and a lot of quite pathological)...

(I'm also curious if we could get away with doing a lot less type inference in right-hand-sides and function bodies in stub files in general -- but again this would...

It's intentional that we haven't so far implemented support for this kind of narrowing, because it is unsound. The type `str` includes subclasses of `str`, which are permitted to implement...

We could add a diagnostic that prohibits overriding `__eq__` on subclasses of all types for which we have literal types, and then go ahead and implement this kind of narrowing....

> Would we ever consider special casing an example like `lambda x: x` and inferring `(T) -> T` for this? Yes, that's definitely one strategy that can be used here,...

Thanks for the report! What ty is (subtly) telling you here is that it is possible for there to exist a subclass of `Area` that is also a subclass of...

Another thing we could try to do here (and in #1567 and similar issues) is add better explanatory diagnostics. This is tricky since these issues tend to manifest as just...

> Another thing we could try to do here (and in [#1567](https://github.com/astral-sh/ty/issues/1567) and similar issues) is add better explanatory diagnostics. This is tricky since these issues tend to manifest as...

Thanks for reporting this! Barring a change to typeshed (or a change in our handling of `float` annotations generally) we would need to special-case methods known to return just-float (or...

Yes, I suspect that you need something like `zoho_books_client: ZohoBooksClient` (or whatever the type is actually called) on the class body of whatever class includes the `get_quote` method, so we...