Stanislav Terliakov

Results 173 comments of Stanislav Terliakov

Could you explain further why you expect different output? `Any` is compatible with any bound, type passed as argument is not parameterized hence defaults all tvars to any, why should...

Ah, sorry, I missed that numpy already started using tvars defaults. So the problem reduces to the following, right? ```python from typing import Any, Generic, TypeVar T = TypeVar("T", default=int)...

Nah, this is the correct use for `type` - `TypeForm` is not needed when you have an actual class. TypeForm is compatible with things like `TypeVar` itself, should be irrelevant...

Mhm, you can run `mypy ... --cache-dir=/dev/null` to rule that out, or remove `.mypy_cache` dir manually. Not applicable to tests, everything is cleaned up after a test run.

Pyright gives even funnier results - it considers this assert always-false, marking `assert_type` as unreachable. Clearly an intersection `Sequence[int | bytes] & Sequence[int | str]` isn't empty. Pyrefly does the...

Just replace the discovery patch with `pytest.skip()` in `TypeCheckSuite.run_case`, I guess? https://github.com/python/mypy/blob/985dc7f5b03f384066d91e54065d21cfbc063edd/mypy/test/testcheck.py#L41-L60

I can confirm that I still think this code is safe - please enlighten me if I misunderstand the `TypeIs` semantics, but this looks exactly like the intended use case...

But why do you consider it a bug? At class level `A` is still `Cat`, and that's intended. Why should inlay hint show a type "as seen by foreign callers"...

This would break PEP484 compliance of `mypy`. To [quote](https://peps.python.org/pep-0484/#the-meaning-of-annotations), > For a checked function, the default annotation for arguments and for the return type is Any. An exception is the...

I'm actually quite against doing that, I love that all annotations are "opt in", and I do not have subtle errors and bunch of type-ignore comments when interfacing with some...