Stanislav Terliakov

Results 173 comments of Stanislav Terliakov

I don't want to add any enum tests here, they won't be representative due to #19594 - I'd prefer to add `match` equivalents to tests there once this PR is...

Oh. This is not a PEP695 issue, "old-style" variables suffer from the same. The problem is ID collision in `typeanal.fix_instance`. We see ``Foo[Y`2, X`1]``, and `Y` is the same (same...

It goes roughly as follows: for every `(declared_typearg, provided_typearg)` pair (`zip_longest` with None), map declared ID to the provided type (if provided is missing, we pick default or Any). Then...

...wait, can we just skip the provided args? ```diff diff --git a/mypy/typeanal.py b/mypy/typeanal.py index 99cc56ae0..251b6d46a 100644 --- a/mypy/typeanal.py +++ b/mypy/typeanal.py @@ -2099,7 +2099,7 @@ def fix_instance( ) arg = any_type...

No, my patch is still wrong - it fixes this case but not the following (expected `Foo[Y, X, Y]`): ```python class Foo[X, Y, Z=X]: def test(self, swapped: Foo[Y, X]) ->...

I'd say this check should *only* fire for function locals. Redundant annotations at top level (globals) and class members should be fine - they declare the public interface explicitly. If...

The same happens for top-level files without namespace packages. Let's say that a package `a` ships `foo.py` in version `0.1.0`. In version `0.2.0` it splits into `a` and `b`, `foo.py`...

Could you explain the problem? `()` aka empty tuple is the only correct parameterization here, what output do you expect? Zero args form an empty tuple, and `MyCls[()]` is what...

[x] (resolved) Upgrading 1.18.2 to 1.19.0 cannot be performed with `pip install -U`. Am I missing any workarounds? If not, #20006 should probably be ALL CAPS and **bold** in the...

> We haven't released 1.19.0 yet Yep, sorry, I was trying to say that if 1.19.0 were released from current master branch, `pip install -U` would silently produce a broken...