Stanislav Terliakov

Results 173 comments of Stanislav Terliakov

This is funny! Yes, type vars are now bound in the function body if typevar is used in argument types or return types (or comes from parent scope - class...

mypy simply does not support aliased `dataclass` at all. ```python from dataclasses import dataclass dataclass_alias = dataclass @dataclass class Ok: a: int = 1 @dataclass_alias class Bad: a: int =...

Hm, I don't see any straightforward solution that could set constraints priorities reliably. But your Literal suggestion sounds interesting, I'll try to expand this PR tomorrow to cover this case

OK, `Literal` constraints are significantly different, nothing prevents their precise inference - we already keep track of `last_known_value`. That should be handled in `join.py` instead and does not belong to...

The primer change is bad but unrelated. Opened #19358 to address it.

TBH, I tend to agree with @ilevkivskyi - there's a balance between "we want to support this case correctly" and "we don't want to embed too many library-specific details into...

@ilevkivskyi tagging you since you gave some feedback on the first revision. I managed to remove the scary part - error messages are less specific now, but only `special_sig =...

> LG, I don't really understand the bound start args logic, but it will be easy to tweak if it will cause problems. I just invented a counterexample to that...

Primer diff shows only one false positive removed. That error was caused exactly by mistreatment fixed in this PR.

This is being discussed at https://discuss.python.org/t/overloads-of-async-generators-inconsistent-coroutine-wrapping/56665.