Carl Meyer
Carl Meyer
@ibraheemdev does this example fall into the category of "needs new constraint solver"? https://play.ty.dev/68b3e41b-7eee-4658-ae20-3a2b0f59fb7d ```py from collections.abc import Mapping from typing import Literal def process(data_types: Mapping[str, Literal["BOOL", "INT", "FLOAT"]], /)...
I think that unless we can understand such cases better, we should probably silence `possibly-unbound-import` by default as too noisy with false positives.
But isn't this kind of thing a valid use case for abstract types and methods? ```py # A is a type with abstract methods def f(a: A): a.some_abstract_method() ``` where...
That one seems more narrowly focused around one particular UX improvement -- detecting compiled modules and giving a better error than "module not found." But I see this issue as...
https://github.com/astral-sh/ty/issues/1591 is an example case of where we could do better here even for pure Python packages. Pandas has type annotations inline (presumably for internal type checking?), but there's also...
Just a note as we consider this: intersecting with `FunctionType` is one way to avoid these errors, and `isinstance(typed_as_callable, FunctionType):` is one way to synthesize that intersection in ty, without...
I'm still not clear on whether we should do this. It seems plausible to instead say "what other type checkers are doing here is unsafe, if you want to access...
The downside of isinstance `FunctionType` is that currently we'll infer a Todo type if you try to call the intersection, and once we fix that, I think a correct implementation...
> If `T`, `U` and `S` are all fully static, `T & ~U` is only assignable to `S` if `T` is a subtype of `S` and `U` is disjoint from...
> I'm not sure this has anything to do with protocols. Yes, it's definitely possible that it doesn't. One thing I observed is that `str` is not assignable to `Buffer`,...