Stanislav Terliakov
Stanislav Terliakov
Working playground link: https://mypy-play.net/?mypy=master&python=3.12&gist=525c6298e4a1367cfba7fc00d042feea This is another example of #12025, just with different common ancestor: `str` and `tuple[str]` are both `Sequence[str]`, usually this manifests as `object` type in unexpected places,...
Damn, sorry, I typoed or copied wrong issue number... That should be #12056, a long-standing issue that isn't resolved yet.
Looks good! However, I'm afraid that `NoReturn` in third position is not actually enforced by any means for user-defined generator subclasses. ``` from typing import * class G(Generator[int, None, Never]):...
I'll think about this tomorrow. `__next__` is the right place for `raise StopIteration`, restricting it to `__iter__` would be weird. The problem stems from the fact that `_ReturnT` is only...
Hm, okay, I revisited this once again, maybe it's not really a blocker and we should file a separate feature request to check third type argument of `Generator` more strictly....
Funny enough, the following typechecks (note how `async` disappears in `overload` stubs). This seems to be the same kind of problem as functions/methods and decorators: too much of "indirectly applied"...
@TeamSpen210 well, it could, but such treatment should be consistent - either reject all or accept all. ```python from typing_extensions import Unpack def foo() -> tuple[int, Unpack[tuple[str, ...]]]: return 1,...
For me `"Never" has no attribute "foo"` is an early indicator of failed/impossible inference. Allowing arbitrary lookups on `Never` may prevent that from happening, potentially breaking some funny typing patterns...
> marks any block with a variable bound to Never as unreachable. Well, then we won't see "`Never` has no attribute ..." at all, so it doesn't really matter whether...