From 84934aedd02051144408a7168c1350b8ca2e8cc3 Mon Sep 17 00:00:00 2001 From: kotlinisland <65446343+kotlinisland@users.noreply.github.com> Date: Mon, 9 Mar 2026 12:58:09 +1000 Subject: [PATCH 1/2] specify that type variable tuples and parameter specification should have variance --- .../basilisk/generics_paramspec_variance.toml | 26 ++++++ .../basilisk/generics_typevartuple_basic.toml | 0 .../generics_typevartuple_variance.toml | 34 ++++++++ .../mypy/generics_paramspec_variance.toml | 22 ++++++ .../mypy/generics_typevartuple_basic.toml | 16 ++-- .../mypy/generics_typevartuple_variance.toml | 28 +++++++ .../generics_paramspec_variance.toml | 25 ++++++ .../generics_typevartuple_basic.toml | 19 ++--- .../generics_typevartuple_variance.toml | 34 ++++++++ .../pyrefly/generics_paramspec_variance.toml | 26 ++++++ .../pyrefly/generics_typevartuple_basic.toml | 16 ++-- .../generics_typevartuple_variance.toml | 34 ++++++++ .../pyright/generics_paramspec_variance.toml | 46 +++++++++++ .../pyright/generics_typevartuple_basic.toml | 20 ++--- .../generics_typevartuple_variance.toml | 72 +++++++++++++++++ .../ty/generics_paramspec_variance.toml | 17 ++++ .../ty/generics_typevartuple_basic.toml | 17 ++-- .../ty/generics_typevartuple_variance.toml | 24 ++++++ .../zuban/generics_paramspec_variance.toml | 22 ++++++ .../zuban/generics_typevartuple_basic.toml | 16 ++-- .../zuban/generics_typevartuple_variance.toml | 34 ++++++++ .../tests/generics_paramspec_variance.py | 58 ++++++++++++++ .../tests/generics_typevartuple_basic.py | 10 ++- .../tests/generics_typevartuple_variance.py | 79 +++++++++++++++++++ docs/spec/generics.rst | 37 +++++---- 25 files changed, 661 insertions(+), 71 deletions(-) create mode 100644 conformance/results/basilisk/generics_paramspec_variance.toml create mode 100644 conformance/results/basilisk/generics_typevartuple_basic.toml create mode 100644 conformance/results/basilisk/generics_typevartuple_variance.toml create mode 100644 conformance/results/mypy/generics_paramspec_variance.toml create mode 100644 conformance/results/mypy/generics_typevartuple_variance.toml create mode 100644 conformance/results/pycroscope/generics_paramspec_variance.toml create mode 100644 conformance/results/pycroscope/generics_typevartuple_variance.toml create mode 100644 conformance/results/pyrefly/generics_paramspec_variance.toml create mode 100644 conformance/results/pyrefly/generics_typevartuple_variance.toml create mode 100644 conformance/results/pyright/generics_paramspec_variance.toml create mode 100644 conformance/results/pyright/generics_typevartuple_variance.toml create mode 100644 conformance/results/ty/generics_paramspec_variance.toml create mode 100644 conformance/results/ty/generics_typevartuple_variance.toml create mode 100644 conformance/results/zuban/generics_paramspec_variance.toml create mode 100644 conformance/results/zuban/generics_typevartuple_variance.toml create mode 100644 conformance/tests/generics_paramspec_variance.py create mode 100644 conformance/tests/generics_typevartuple_variance.py diff --git a/conformance/results/basilisk/generics_paramspec_variance.toml b/conformance/results/basilisk/generics_paramspec_variance.toml new file mode 100644 index 000000000..8c3829208 --- /dev/null +++ b/conformance/results/basilisk/generics_paramspec_variance.toml @@ -0,0 +1,26 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 40: Expected 1 errors +Line 51: Expected 1 errors +Line 22: Unexpected errors ['generics_paramspec_variance.py:22:1: error: Type `ContravariantParamSpec[object]` is not assignable to `ContravariantParamSpec[int]` (type parameter is invariant) [generics_variance_inference]'] +Line 31: Unexpected errors ['generics_paramspec_variance.py:31:1: error: Type `CovariantParamSpec[int]` is not assignable to `CovariantParamSpec[object]` (type parameter is invariant) [generics_variance_inference]'] +Line 33: Unexpected errors ['generics_paramspec_variance.py:33:7: error: `ParamSpec` `InP` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic]'] +Line 45: Unexpected errors ['generics_paramspec_variance.py:45:1: error: Type `ContravariantParamSpecOld[object]` is not assignable to `ContravariantParamSpecOld[int]` (type parameter is contravariant) [generics_variance_inference]'] +Line 47: Unexpected errors ['generics_paramspec_variance.py:47:8: error: `ParamSpec` `OutP` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic]'] +Line 58: Unexpected errors ['generics_paramspec_variance.py:58:1: error: Type `CovariantParamSpecOld[int]` is not assignable to `CovariantParamSpecOld[object]` (type parameter is covariant) [generics_variance_inference]'] +""" +output = """ +generics_paramspec_variance.py:14:1: error: Type `InvariantParamSpec[int]` is not assignable to `InvariantParamSpec[object]` (type parameter is invariant) [generics_variance_inference] +generics_paramspec_variance.py:15:1: error: Type `InvariantParamSpec[object]` is not assignable to `InvariantParamSpec[int]` (type parameter is invariant) [generics_variance_inference] +generics_paramspec_variance.py:21:1: error: Type `ContravariantParamSpec[int]` is not assignable to `ContravariantParamSpec[object]` (type parameter is invariant) [generics_variance_inference] +generics_paramspec_variance.py:22:1: error: Type `ContravariantParamSpec[object]` is not assignable to `ContravariantParamSpec[int]` (type parameter is invariant) [generics_variance_inference] +generics_paramspec_variance.py:30:1: error: Type `CovariantParamSpec[object]` is not assignable to `CovariantParamSpec[int]` (type parameter is invariant) [generics_variance_inference] +generics_paramspec_variance.py:31:1: error: Type `CovariantParamSpec[int]` is not assignable to `CovariantParamSpec[object]` (type parameter is invariant) [generics_variance_inference] +generics_paramspec_variance.py:33:7: error: `ParamSpec` `InP` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic] +generics_paramspec_variance.py:44:1: error: Type `ContravariantParamSpecOld[int]` is not assignable to `ContravariantParamSpecOld[object]` (type parameter is contravariant) [generics_variance_inference] +generics_paramspec_variance.py:45:1: error: Type `ContravariantParamSpecOld[object]` is not assignable to `ContravariantParamSpecOld[int]` (type parameter is contravariant) [generics_variance_inference] +generics_paramspec_variance.py:47:8: error: `ParamSpec` `OutP` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic] +generics_paramspec_variance.py:57:1: error: Type `CovariantParamSpecOld[object]` is not assignable to `CovariantParamSpecOld[int]` (type parameter is covariant) [generics_variance_inference] +generics_paramspec_variance.py:58:1: error: Type `CovariantParamSpecOld[int]` is not assignable to `CovariantParamSpecOld[object]` (type parameter is covariant) [generics_variance_inference] +""" diff --git a/conformance/results/basilisk/generics_typevartuple_basic.toml b/conformance/results/basilisk/generics_typevartuple_basic.toml new file mode 100644 index 000000000..e69de29bb diff --git a/conformance/results/basilisk/generics_typevartuple_variance.toml b/conformance/results/basilisk/generics_typevartuple_variance.toml new file mode 100644 index 000000000..c26f5e4e9 --- /dev/null +++ b/conformance/results/basilisk/generics_typevartuple_variance.toml @@ -0,0 +1,34 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 16: Expected 1 errors +Line 35: Expected 1 errors +Line 60: Expected 1 errors +Line 71: Expected 1 errors +Line 24: Unexpected errors ['generics_typevartuple_variance.py:24:1: error: Type `ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` (type parameter is contravariant) [generics_variance_inference]'] +Line 33: Unexpected errors ['generics_typevartuple_variance.py:33:1: error: Type `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` (type parameter is covariant) [generics_variance_inference]'] +Line 54: Unexpected errors ['generics_typevartuple_variance.py:54:8: error: `TypeVarTuple` `InTs` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic]', 'generics_typevartuple_variance.py:54:8: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support variance specification [generics_typevartuple_basic_3]'] +Line 65: Unexpected errors ['generics_typevartuple_variance.py:65:1: error: Type `ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` (type parameter is contravariant) [generics_variance_inference]'] +Line 68: Unexpected errors ['generics_typevartuple_variance.py:68:9: error: `TypeVarTuple` `OutTs` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic]', 'generics_typevartuple_variance.py:68:9: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support variance specification [generics_typevartuple_basic_3]'] +Line 79: Unexpected errors ['generics_typevartuple_variance.py:79:1: error: Type `CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` (type parameter is covariant) [generics_variance_inference]'] +""" +output = """ +generics_typevartuple_variance.py:14:1: error: Type `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[object]` (type parameter is invariant) [generics_variance_inference] +generics_typevartuple_variance.py:15:1: error: Type `InvariantTypeVarTuple[object]` is not assignable to `InvariantTypeVarTuple[int]` (type parameter is invariant) [generics_variance_inference] +generics_typevartuple_variance.py:23:1: error: Type `ContravariantTypeVarTuple[int]` is not assignable to `ContravariantTypeVarTuple[object]` (type parameter is contravariant) [generics_variance_inference] +generics_typevartuple_variance.py:24:1: error: Type `ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` (type parameter is contravariant) [generics_variance_inference] +generics_typevartuple_variance.py:32:1: error: Type `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` (type parameter is covariant) [generics_variance_inference] +generics_typevartuple_variance.py:33:1: error: Type `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` (type parameter is covariant) [generics_variance_inference] +generics_typevartuple_variance.py:36:1: error: Type `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[float]` (type parameter is covariant) [generics_variance_inference] +generics_typevartuple_variance.py:37:1: error: Type `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[float]` (type parameter is covariant) [generics_variance_inference] +generics_typevartuple_variance.py:50:1: error: Type `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` (type parameter is invariant) [generics_variance_inference] +generics_typevartuple_variance.py:51:1: error: Type `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` (type parameter is invariant) [generics_variance_inference] +generics_typevartuple_variance.py:54:8: error: `TypeVarTuple` `InTs` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic] +generics_typevartuple_variance.py:54:8: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support variance specification [generics_typevartuple_basic_3] +generics_typevartuple_variance.py:64:1: error: Type `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` (type parameter is contravariant) [generics_variance_inference] +generics_typevartuple_variance.py:65:1: error: Type `ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` (type parameter is contravariant) [generics_variance_inference] +generics_typevartuple_variance.py:68:9: error: `TypeVarTuple` `OutTs` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic] +generics_typevartuple_variance.py:68:9: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support variance specification [generics_typevartuple_basic_3] +generics_typevartuple_variance.py:78:1: error: Type `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` (type parameter is covariant) [generics_variance_inference] +generics_typevartuple_variance.py:79:1: error: Type `CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` (type parameter is covariant) [generics_variance_inference] +""" diff --git a/conformance/results/mypy/generics_paramspec_variance.toml b/conformance/results/mypy/generics_paramspec_variance.toml new file mode 100644 index 000000000..78fb77e60 --- /dev/null +++ b/conformance/results/mypy/generics_paramspec_variance.toml @@ -0,0 +1,22 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 30: Expected 1 errors +Line 40: Expected 1 errors +Line 51: Expected 1 errors +Line 57: Expected 1 errors +Line 31: Unexpected errors ['generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment]'] +Line 33: Unexpected errors ['generics_paramspec_variance.py:33: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 47: Unexpected errors ['generics_paramspec_variance.py:47: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 58: Unexpected errors ['generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]'] +""" +output = """ +generics_paramspec_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantParamSpec[[int]]", variable has type "InvariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:21: error: Incompatible types in assignment (expression has type "ContravariantParamSpec[[int]]", variable has type "ContravariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:33: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:44: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:47: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment] +""" diff --git a/conformance/results/mypy/generics_typevartuple_basic.toml b/conformance/results/mypy/generics_typevartuple_basic.toml index c9a734127..5bf562c64 100644 --- a/conformance/results/mypy/generics_typevartuple_basic.toml +++ b/conformance/results/mypy/generics_typevartuple_basic.toml @@ -3,19 +3,19 @@ notes = """ Does not enforce that tuples captured by `TypeVarTuple` are same length. """ output = """ -generics_typevartuple_basic.py:42: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" [arg-type] -generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" [arg-type] -generics_typevartuple_basic.py:45: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type] -generics_typevartuple_basic.py:52: error: Free type variable expected in Generic[...] [misc] -generics_typevartuple_basic.py:53: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:56: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] +generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" [arg-type] +generics_typevartuple_basic.py:44: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" [arg-type] +generics_typevartuple_basic.py:46: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type] +generics_typevartuple_basic.py:53: error: Free type variable expected in Generic[...] [misc] +generics_typevartuple_basic.py:54: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:57: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:60: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" [misc] generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" [misc] generics_typevartuple_basic.py:100: error: Cannot infer value of type parameter "Shape" of "multiply" [misc] generics_typevartuple_basic.py:101: error: Cannot infer value of type parameter "Shape" of "multiply" [misc] generics_typevartuple_basic.py:107: error: Can only use one type var tuple in a class def [misc] +generics_typevartuple_basic.py:111: error: Can only use one type var tuple in a class def [misc] """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/generics_typevartuple_variance.toml b/conformance/results/mypy/generics_typevartuple_variance.toml new file mode 100644 index 000000000..4a1bc2d81 --- /dev/null +++ b/conformance/results/mypy/generics_typevartuple_variance.toml @@ -0,0 +1,28 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 14: Expected 1 errors +Line 16: Expected 1 errors +Line 50: Expected 1 errors +Line 60: Expected 1 errors +Line 64: Expected 1 errors +Line 71: Expected 1 errors +Line 24: Unexpected errors ['generics_typevartuple_variance.py:24: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] +Line 54: Unexpected errors ['generics_typevartuple_variance.py:54: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc]'] +Line 65: Unexpected errors ['generics_typevartuple_variance.py:65: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment]'] +Line 68: Unexpected errors ['generics_typevartuple_variance.py:68: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc]'] +""" +output = """ +generics_typevartuple_variance.py:15: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[object]", variable has type "InvariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:23: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[int]", variable has type "ContravariantTypeVarTuple[object, object]") [assignment] +generics_typevartuple_variance.py:24: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:32: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object]", variable has type "CovariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:35: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int, object]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] +generics_typevartuple_variance.py:36: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, int]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] +generics_typevartuple_variance.py:37: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, object]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] +generics_typevartuple_variance.py:51: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[object]", variable has type "InvariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:54: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:65: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:68: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:78: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[object]", variable has type "CovariantTypeVarTupleOld[int]") [assignment] +""" diff --git a/conformance/results/pycroscope/generics_paramspec_variance.toml b/conformance/results/pycroscope/generics_paramspec_variance.toml new file mode 100644 index 000000000..df399c3f9 --- /dev/null +++ b/conformance/results/pycroscope/generics_paramspec_variance.toml @@ -0,0 +1,25 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 40: Expected 1 errors +Line 51: Expected 1 errors +Line 19: Unexpected errors ['./generics_paramspec_variance.py:19:23: Traceback (most recent call last):', './generics_paramspec_variance.py:19:4: Traceback (most recent call last):'] +Line 22: Unexpected errors ['./generics_paramspec_variance.py:22:38: Traceback (most recent call last):'] +Line 31: Unexpected errors ['./generics_paramspec_variance.py:31:38: Traceback (most recent call last):'] +Line 45: Unexpected errors ['./generics_paramspec_variance.py:45:45: Traceback (most recent call last):'] +Line 58: Unexpected errors ['./generics_paramspec_variance.py:58:45: Traceback (most recent call last):'] +""" +output = """ +./generics_paramspec_variance.py:14:41: Traceback (most recent call last): +./generics_paramspec_variance.py:15:38: Traceback (most recent call last): +./generics_paramspec_variance.py:19:23: Traceback (most recent call last): +./generics_paramspec_variance.py:19:4: Traceback (most recent call last): +./generics_paramspec_variance.py:21:41: Traceback (most recent call last): +./generics_paramspec_variance.py:22:38: Traceback (most recent call last): +./generics_paramspec_variance.py:30:35: Traceback (most recent call last): +./generics_paramspec_variance.py:31:38: Traceback (most recent call last): +./generics_paramspec_variance.py:44:48: Traceback (most recent call last): +./generics_paramspec_variance.py:45:45: Traceback (most recent call last): +./generics_paramspec_variance.py:57:42: Traceback (most recent call last): +./generics_paramspec_variance.py:58:45: Traceback (most recent call last): +""" diff --git a/conformance/results/pycroscope/generics_typevartuple_basic.toml b/conformance/results/pycroscope/generics_typevartuple_basic.toml index 842c7ca46..ba2e31ecd 100644 --- a/conformance/results/pycroscope/generics_typevartuple_basic.toml +++ b/conformance/results/pycroscope/generics_typevartuple_basic.toml @@ -1,15 +1,16 @@ -conformance_automated = "Pass" +conformant = "Unsupported" +conformance_automated = "Fail" errors_diff = """ +Line 111: Expected 1 errors """ output = """ -./generics_typevartuple_basic.py:42:33: Incompatible argument type for shape: expected tuple[*tuple[Shape, ...]] but got NewType('Height', int) [incompatible_argument] -./generics_typevartuple_basic.py:43:0: Incompatible assignment: expected ./generics_typevartuple_basic.py.Array[NewType('Batch', int), NewType('Height', int), NewType('Width', int)], got ./generics_typevartuple_basic.py.Array~[NewType('Batch', int), NewType('Width', int)] [incompatible_assignment] -./generics_typevartuple_basic.py:44:0: Incompatible assignment: expected ./generics_typevartuple_basic.py.Array[NewType('Time', int), NewType('Batch', int), NewType('Height', int), NewType('Width', int)], got ./generics_typevartuple_basic.py.Array~[NewType('Time', int), NewType('Batch', int), NewType('Width', int), NewType('Height', int)] [incompatible_assignment] -./generics_typevartuple_basic.py:52:21: TypeVarTuple must be unpacked [invalid_base] -./generics_typevartuple_basic.py:53:30: TypeVarTuple must be unpacked [invalid_annotation] -./generics_typevartuple_basic.py:56:27: TypeVarTuple must be unpacked [invalid_annotation] -./generics_typevartuple_basic.py:59:17: TypeVarTuple must be unpacked [invalid_annotation] -./generics_typevartuple_basic.py:65:6: In call to typing.TypeVarTuple: Got an unexpected keyword argument 'covariant' [incompatible_call] +./generics_typevartuple_basic.py:43:33: Incompatible argument type for shape: expected tuple[*tuple[Shape, ...]] but got NewType('Height', int) [incompatible_argument] +./generics_typevartuple_basic.py:44:0: Incompatible assignment: expected ./generics_typevartuple_basic.py.Array[NewType('Batch', int), NewType('Height', int), NewType('Width', int)], got ./generics_typevartuple_basic.py.Array~[NewType('Batch', int), NewType('Width', int)] [incompatible_assignment] +./generics_typevartuple_basic.py:45:0: Incompatible assignment: expected ./generics_typevartuple_basic.py.Array[NewType('Time', int), NewType('Batch', int), NewType('Height', int), NewType('Width', int)], got ./generics_typevartuple_basic.py.Array~[NewType('Time', int), NewType('Batch', int), NewType('Width', int), NewType('Height', int)] [incompatible_assignment] +./generics_typevartuple_basic.py:53:21: TypeVarTuple must be unpacked [invalid_base] +./generics_typevartuple_basic.py:54:30: TypeVarTuple must be unpacked [invalid_annotation] +./generics_typevartuple_basic.py:57:27: TypeVarTuple must be unpacked [invalid_annotation] +./generics_typevartuple_basic.py:60:17: TypeVarTuple must be unpacked [invalid_annotation] ./generics_typevartuple_basic.py:66:6: In call to typing.TypeVarTuple: Takes 1 positional arguments but 3 were given [incompatible_call] ./generics_typevartuple_basic.py:67:6: In call to typing.TypeVarTuple: Got an unexpected keyword argument 'bound' [incompatible_call] ./generics_typevartuple_basic.py:91:0: Cannot resolve type variables [incompatible_call] diff --git a/conformance/results/pycroscope/generics_typevartuple_variance.toml b/conformance/results/pycroscope/generics_typevartuple_variance.toml new file mode 100644 index 000000000..a7b0a2c61 --- /dev/null +++ b/conformance/results/pycroscope/generics_typevartuple_variance.toml @@ -0,0 +1,34 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 16: Expected 1 errors +Line 60: Expected 1 errors +Line 71: Expected 1 errors +Line 24: Unexpected errors ['./generics_typevartuple_variance.py:24:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[int], got ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[object] [incompatible_assignment]'] +Line 33: Unexpected errors ['./generics_typevartuple_variance.py:33:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[object], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int] [incompatible_assignment]'] +Line 34: Unexpected errors ['./generics_typevartuple_variance.py:34:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[float | int, float | int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int, int] [incompatible_assignment]'] +Line 54: Unexpected errors ["./generics_typevartuple_variance.py:54:7: Error calling (name: str, /, *, default: TypeForm[object] = , bound: TypeForm[object] = , covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False]) -> typing_extensions.TypeVarTuple (with impl): TypeVarTuple.__new__() got an unexpected keyword argument 'contravariant' [incompatible_call]"] +Line 65: Unexpected errors ['./generics_typevartuple_variance.py:65:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[int], got ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[object] [incompatible_assignment]'] +Line 68: Unexpected errors ["./generics_typevartuple_variance.py:68:8: Error calling (name: str, /, *, default: TypeForm[object] = , bound: TypeForm[object] = , covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False]) -> typing_extensions.TypeVarTuple (with impl): TypeVarTuple.__new__() got an unexpected keyword argument 'covariant' [incompatible_call]"] +Line 79: Unexpected errors ['./generics_typevartuple_variance.py:79:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[object], got ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[int] [incompatible_assignment]'] +""" +output = """ +./generics_typevartuple_variance.py:14:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.InvariantTypeVarTuple[object], got ./generics_typevartuple_variance.py.InvariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:15:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.InvariantTypeVarTuple[int], got ./generics_typevartuple_variance.py.InvariantTypeVarTuple[object] [incompatible_assignment] +./generics_typevartuple_variance.py:23:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[object, object], got ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:24:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[int], got ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[object] [incompatible_assignment] +./generics_typevartuple_variance.py:32:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[object] [incompatible_assignment] +./generics_typevartuple_variance.py:33:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[object], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:34:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[float | int, float | int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int, int] [incompatible_assignment] +./generics_typevartuple_variance.py:35:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[float | int, float | int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int, object] [incompatible_assignment] +./generics_typevartuple_variance.py:36:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[float | int, float | int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[object, int] [incompatible_assignment] +./generics_typevartuple_variance.py:37:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[float | int, float | int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[object, object] [incompatible_assignment] +./generics_typevartuple_variance.py:50:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.InvariantTypeVarTupleOld[object], got ./generics_typevartuple_variance.py.InvariantTypeVarTupleOld[int] [incompatible_assignment] +./generics_typevartuple_variance.py:51:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.InvariantTypeVarTupleOld[int], got ./generics_typevartuple_variance.py.InvariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:54:7: Error calling (name: str, /, *, default: TypeForm[object] = , bound: TypeForm[object] = , covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False]) -> typing_extensions.TypeVarTuple (with impl): TypeVarTuple.__new__() got an unexpected keyword argument 'contravariant' [incompatible_call] +./generics_typevartuple_variance.py:64:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[object], got ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[int] [incompatible_assignment] +./generics_typevartuple_variance.py:65:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[int], got ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:68:8: Error calling (name: str, /, *, default: TypeForm[object] = , bound: TypeForm[object] = , covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False]) -> typing_extensions.TypeVarTuple (with impl): TypeVarTuple.__new__() got an unexpected keyword argument 'covariant' [incompatible_call] +./generics_typevartuple_variance.py:78:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[int], got ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:79:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[object], got ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[int] [incompatible_assignment] +""" diff --git a/conformance/results/pyrefly/generics_paramspec_variance.toml b/conformance/results/pyrefly/generics_paramspec_variance.toml new file mode 100644 index 000000000..825a4504c --- /dev/null +++ b/conformance/results/pyrefly/generics_paramspec_variance.toml @@ -0,0 +1,26 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 14: Expected 1 errors +Line 21: Expected 1 errors +Line 30: Expected 1 errors +Line 40: Expected 1 errors +Line 51: Expected 1 errors +Line 22: Unexpected errors ['`ContravariantParamSpec[[object]]` is not assignable to `ContravariantParamSpec[[int]]` [bad-assignment]'] +Line 31: Unexpected errors ['`CovariantParamSpec[[int]]` is not assignable to `CovariantParamSpec[[object]]` [bad-assignment]'] +Line 33: Unexpected errors ['Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec]'] +Line 45: Unexpected errors ['`ContravariantParamSpecOld[[object]]` is not assignable to `ContravariantParamSpecOld[[int]]` [bad-assignment]'] +Line 47: Unexpected errors ['Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec]'] +Line 58: Unexpected errors ['`CovariantParamSpecOld[[int]]` is not assignable to `CovariantParamSpecOld[[object]]` [bad-assignment]'] +""" +output = """ +ERROR generics_paramspec_variance.py:15:39-67: `InvariantParamSpec[[object]]` is not assignable to `InvariantParamSpec[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:22:39-71: `ContravariantParamSpec[[object]]` is not assignable to `ContravariantParamSpec[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:31:39-64: `CovariantParamSpec[[int]]` is not assignable to `CovariantParamSpec[[object]]` [bad-assignment] +ERROR generics_paramspec_variance.py:33:24-42: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:44:49-81: `ContravariantParamSpecOld[[int]]` is not assignable to `ContravariantParamSpecOld[[object]]` [bad-assignment] +ERROR generics_paramspec_variance.py:45:46-81: `ContravariantParamSpecOld[[object]]` is not assignable to `ContravariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:47:26-40: Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:57:43-74: `CovariantParamSpecOld[[object]]` is not assignable to `CovariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:58:46-74: `CovariantParamSpecOld[[int]]` is not assignable to `CovariantParamSpecOld[[object]]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/generics_typevartuple_basic.toml b/conformance/results/pyrefly/generics_typevartuple_basic.toml index e4437865d..df28e1648 100644 --- a/conformance/results/pyrefly/generics_typevartuple_basic.toml +++ b/conformance/results/pyrefly/generics_typevartuple_basic.toml @@ -3,18 +3,18 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR generics_typevartuple_basic.py:42:34-43: Argument `Height` is not assignable to parameter `shape` with type `tuple[*@_]` in function `Array.__init__` [bad-argument-type] -ERROR generics_typevartuple_basic.py:43:35-62: `Array[Batch, Width]` is not assignable to `Array[Batch, Height, Width]` [bad-assignment] -ERROR generics_typevartuple_basic.py:44:41-46:2: `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` [bad-assignment] -ERROR generics_typevartuple_basic.py:52:22-27: `TypeVarTuple` must be unpacked [invalid-annotation] -ERROR generics_typevartuple_basic.py:53:37-42: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] -ERROR generics_typevartuple_basic.py:56:34-39: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] -ERROR generics_typevartuple_basic.py:59:24-29: `TypeVarTuple` must be unpacked [invalid-annotation] -ERROR generics_typevartuple_basic.py:65:27-41: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:43:34-43: Argument `Height` is not assignable to parameter `shape` with type `tuple[*@_]` in function `Array.__init__` [bad-argument-type] +ERROR generics_typevartuple_basic.py:44:35-62: `Array[Batch, Width]` is not assignable to `Array[Batch, Height, Width]` [bad-assignment] +ERROR generics_typevartuple_basic.py:45:41-47:2: `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` [bad-assignment] +ERROR generics_typevartuple_basic.py:53:22-27: `TypeVarTuple` must be unpacked [invalid-annotation] +ERROR generics_typevartuple_basic.py:54:37-42: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:57:34-39: `TypeVarTuple` must be unpacked [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:60:24-29: `TypeVarTuple` must be unpacked [invalid-annotation] ERROR generics_typevartuple_basic.py:66:27-30: Unexpected positional argument to TypeVarTuple [invalid-type-var-tuple] ERROR generics_typevartuple_basic.py:67:27-36: Unexpected keyword argument `bound` to TypeVarTuple [invalid-type-var-tuple] ERROR generics_typevartuple_basic.py:91:15-19: Argument `tuple[Literal[0]]` is not assignable to parameter `arg2` with type `tuple[int, int]` in function `func2` [bad-argument-type] ERROR generics_typevartuple_basic.py:100:17-18: Argument `Array[Width]` is not assignable to parameter `y` with type `Array[Height]` in function `multiply` [bad-argument-type] ERROR generics_typevartuple_basic.py:101:17-18: Argument `Array[Height, Width]` is not assignable to parameter `y` with type `Array[Height]` in function `multiply` [bad-argument-type] ERROR generics_typevartuple_basic.py:107:7-13: Type parameters for class may not have more than one TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_basic.py:111:7-13: Type parameters for class may not have more than one TypeVarTuple [invalid-type-var-tuple] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_variance.toml b/conformance/results/pyrefly/generics_typevartuple_variance.toml new file mode 100644 index 000000000..5d23c0f1a --- /dev/null +++ b/conformance/results/pyrefly/generics_typevartuple_variance.toml @@ -0,0 +1,34 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 16: Expected 1 errors +Line 60: Expected 1 errors +Line 71: Expected 1 errors +Line 24: Unexpected errors ['`ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment]'] +Line 33: Unexpected errors ['`CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` [bad-assignment]'] +Line 34: Unexpected errors ['`CovariantTypeVarTuple[int, int]` is not assignable to `CovariantTypeVarTuple[float, float]` [bad-assignment]'] +Line 54: Unexpected errors ['Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple]'] +Line 65: Unexpected errors ['`ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` [bad-assignment]'] +Line 68: Unexpected errors ['Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple]'] +Line 79: Unexpected errors ['`CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` [bad-assignment]'] +""" +output = """ +ERROR generics_typevartuple_variance.py:14:45-73: `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:15:42-73: `InvariantTypeVarTuple[object]` is not assignable to `InvariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:23:53-85: `ContravariantTypeVarTuple[int]` is not assignable to `ContravariantTypeVarTuple[object, object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:24:42-77: `ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:32:39-70: `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:33:42-70: `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:34:54-88: `CovariantTypeVarTuple[int, int]` is not assignable to `CovariantTypeVarTuple[float, float]` [bad-assignment] +ERROR generics_typevartuple_variance.py:35:54-91: `CovariantTypeVarTuple[int, object]` is not assignable to `CovariantTypeVarTuple[float, float]` [bad-assignment] +ERROR generics_typevartuple_variance.py:36:54-91: `CovariantTypeVarTuple[object, int]` is not assignable to `CovariantTypeVarTuple[float, float]` [bad-assignment] +ERROR generics_typevartuple_variance.py:37:54-94: `CovariantTypeVarTuple[object, object]` is not assignable to `CovariantTypeVarTuple[float, float]` [bad-assignment] +ERROR generics_typevartuple_variance.py:50:45-76: `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:51:42-76: `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:54:29-47: Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:64:52-87: `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:65:49-87: `ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:68:31-45: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:78:46-80: `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:79:49-80: `CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` [bad-assignment] +""" diff --git a/conformance/results/pyright/generics_paramspec_variance.toml b/conformance/results/pyright/generics_paramspec_variance.toml new file mode 100644 index 000000000..a620f0588 --- /dev/null +++ b/conformance/results/pyright/generics_paramspec_variance.toml @@ -0,0 +1,46 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 40: Expected 1 errors +Line 51: Expected 1 errors +Line 22: Unexpected errors ['generics_paramspec_variance.py:22:39 - error: Type "ContravariantParamSpec[(object)]" is not assignable to declared type "ContravariantParamSpec[(int)]"'] +Line 31: Unexpected errors ['generics_paramspec_variance.py:31:39 - error: Type "CovariantParamSpec[(int)]" is not assignable to declared type "CovariantParamSpec[(object)]"'] +Line 33: Unexpected errors ['generics_paramspec_variance.py:33:24 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] +Line 45: Unexpected errors ['generics_paramspec_variance.py:45:46 - error: Type "ContravariantParamSpecOld[(object)]" is not assignable to declared type "ContravariantParamSpecOld[(int)]"'] +Line 47: Unexpected errors ['generics_paramspec_variance.py:47:26 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] +Line 58: Unexpected errors ['generics_paramspec_variance.py:58:46 - error: Type "CovariantParamSpecOld[(int)]" is not assignable to declared type "CovariantParamSpecOld[(object)]"'] +""" +output = """ +generics_paramspec_variance.py:14:42 - error: Type "InvariantParamSpec[(int)]" is not assignable to declared type "InvariantParamSpec[(object)]" +  "InvariantParamSpec[(int)]" is not assignable to "InvariantParamSpec[(object)]" +    Type parameter "InOutP@InvariantParamSpec" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +generics_paramspec_variance.py:15:39 - error: Type "InvariantParamSpec[(object)]" is not assignable to declared type "InvariantParamSpec[(int)]" +  "InvariantParamSpec[(object)]" is not assignable to "InvariantParamSpec[(int)]" +    Type parameter "InOutP@InvariantParamSpec" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:21:42 - error: Type "ContravariantParamSpec[(int)]" is not assignable to declared type "ContravariantParamSpec[(object)]" +  "ContravariantParamSpec[(int)]" is not assignable to "ContravariantParamSpec[(object)]" +    Type parameter "InP@ContravariantParamSpec" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +generics_paramspec_variance.py:22:39 - error: Type "ContravariantParamSpec[(object)]" is not assignable to declared type "ContravariantParamSpec[(int)]" +  "ContravariantParamSpec[(object)]" is not assignable to "ContravariantParamSpec[(int)]" +    Type parameter "InP@ContravariantParamSpec" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:30:36 - error: Type "CovariantParamSpec[(object)]" is not assignable to declared type "CovariantParamSpec[(int)]" +  "CovariantParamSpec[(object)]" is not assignable to "CovariantParamSpec[(int)]" +    Type parameter "OutP@CovariantParamSpec" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:31:39 - error: Type "CovariantParamSpec[(int)]" is not assignable to declared type "CovariantParamSpec[(object)]" +  "CovariantParamSpec[(int)]" is not assignable to "CovariantParamSpec[(object)]" +    Type parameter "OutP@CovariantParamSpec" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +generics_paramspec_variance.py:33:24 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:44:49 - error: Type "ContravariantParamSpecOld[(int)]" is not assignable to declared type "ContravariantParamSpecOld[(object)]" +  "ContravariantParamSpecOld[(int)]" is not assignable to "ContravariantParamSpecOld[(object)]" +    Type parameter "InP@ContravariantParamSpecOld" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +generics_paramspec_variance.py:45:46 - error: Type "ContravariantParamSpecOld[(object)]" is not assignable to declared type "ContravariantParamSpecOld[(int)]" +  "ContravariantParamSpecOld[(object)]" is not assignable to "ContravariantParamSpecOld[(int)]" +    Type parameter "InP@ContravariantParamSpecOld" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:47:26 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:57:43 - error: Type "CovariantParamSpecOld[(object)]" is not assignable to declared type "CovariantParamSpecOld[(int)]" +  "CovariantParamSpecOld[(object)]" is not assignable to "CovariantParamSpecOld[(int)]" +    Type parameter "OutP@CovariantParamSpecOld" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:58:46 - error: Type "CovariantParamSpecOld[(int)]" is not assignable to declared type "CovariantParamSpecOld[(object)]" +  "CovariantParamSpecOld[(int)]" is not assignable to "CovariantParamSpecOld[(object)]" +    Type parameter "OutP@CovariantParamSpecOld" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) +""" diff --git a/conformance/results/pyright/generics_typevartuple_basic.toml b/conformance/results/pyright/generics_typevartuple_basic.toml index 4021237e7..ea0d0a1a8 100644 --- a/conformance/results/pyright/generics_typevartuple_basic.toml +++ b/conformance/results/pyright/generics_typevartuple_basic.toml @@ -7,19 +7,18 @@ errors_diff = """ Line 90: Unexpected errors ['generics_typevartuple_basic.py:90:14 - error: Argument of type "tuple[Literal[\\'0\\']]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2"'] """ output = """ -generics_typevartuple_basic.py:42:34 - error: Argument of type "Height" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" +generics_typevartuple_basic.py:43:34 - error: Argument of type "Height" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__"   "Height" is not assignable to "tuple[*Shape@Array]" (reportArgumentType) -generics_typevartuple_basic.py:43:35 - error: Type "Array[Batch, Width]" is not assignable to declared type "Array[Batch, Height, Width]" +generics_typevartuple_basic.py:44:35 - error: Type "Array[Batch, Width]" is not assignable to declared type "Array[Batch, Height, Width]"   "Array[Batch, Width]" is not assignable to "Array[Batch, Height, Width]"     Type parameter "Shape@Array" is invariant, but "*tuple[Batch, Width]" is not the same as "*tuple[Batch, Height, Width]" (reportAssignmentType) -generics_typevartuple_basic.py:44:41 - error: Type "Array[Time, Batch, Width, Height]" is not assignable to declared type "Array[Time, Batch, Height, Width]" +generics_typevartuple_basic.py:45:41 - error: Type "Array[Time, Batch, Width, Height]" is not assignable to declared type "Array[Time, Batch, Height, Width]"   "Array[Time, Batch, Width, Height]" is not assignable to "Array[Time, Batch, Height, Width]"     Type parameter "Shape@Array" is invariant, but "*tuple[Time, Batch, Width, Height]" is not the same as "*tuple[Time, Batch, Height, Width]" (reportAssignmentType) -generics_typevartuple_basic.py:52:22 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) -generics_typevartuple_basic.py:53:37 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) -generics_typevartuple_basic.py:56:34 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) -generics_typevartuple_basic.py:59:24 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) -generics_typevartuple_basic.py:65:27 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_basic.py:53:22 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) +generics_typevartuple_basic.py:54:37 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) +generics_typevartuple_basic.py:57:34 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) +generics_typevartuple_basic.py:60:24 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) generics_typevartuple_basic.py:66:27 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) generics_typevartuple_basic.py:66:32 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) generics_typevartuple_basic.py:67:27 - error: "bound" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) @@ -34,6 +33,7 @@ generics_typevartuple_basic.py:100:17 - error: Argument of type "Array[Width]" c generics_typevartuple_basic.py:101:17 - error: Argument of type "Array[Height, Width]" cannot be assigned to parameter "y" of type "Array[*Shape@multiply]" in function "multiply"   "Array[Height, Width]" is not assignable to "Array[Height]"     Type parameter "Shape@Array" is invariant, but "*tuple[Height, Width]" is not the same as "*tuple[Height]" (reportArgumentType) -generics_typevartuple_basic.py:107:14 - error: Generic class can have at most one TypeVarTuple type parameter but received multiple ("Ts1", "Ts2") (reportGeneralTypeIssues) -generics_typevartuple_basic.py:107:29 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +generics_typevartuple_basic.py:107:14 - error: Generic class can have at most one TypeVarTuple type parameter but received multiple ("Ts", "Ts1") (reportGeneralTypeIssues) +generics_typevartuple_basic.py:107:28 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) +generics_typevartuple_basic.py:111:7 - error: Generic class can have at most one TypeVarTuple type parameter but received multiple ("Ts1", "Ts2") (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/generics_typevartuple_variance.toml b/conformance/results/pyright/generics_typevartuple_variance.toml new file mode 100644 index 000000000..38247f32f --- /dev/null +++ b/conformance/results/pyright/generics_typevartuple_variance.toml @@ -0,0 +1,72 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 16: Expected 1 errors +Line 60: Expected 1 errors +Line 71: Expected 1 errors +Line 24: Unexpected errors ['generics_typevartuple_variance.py:24:42 - error: Type "ContravariantTypeVarTuple[object]" is not assignable to declared type "ContravariantTypeVarTuple[int]"'] +Line 33: Unexpected errors ['generics_typevartuple_variance.py:33:42 - error: Type "CovariantTypeVarTuple[int]" is not assignable to declared type "CovariantTypeVarTuple[object]"'] +Line 34: Unexpected errors ['generics_typevartuple_variance.py:34:54 - error: Type "CovariantTypeVarTuple[int, int]" is not assignable to declared type "CovariantTypeVarTuple[float, float]"'] +Line 43: Unexpected errors ['generics_typevartuple_variance.py:43:27 - error: Unpack operator not allowed in type expression (reportInvalidTypeForm)', 'generics_typevartuple_variance.py:43:28 - error: "InTs" is not defined (reportUndefinedVariable)'] +Line 46: Unexpected errors ['generics_typevartuple_variance.py:46:31 - error: "InTs" is not defined (reportUndefinedVariable)', 'generics_typevartuple_variance.py:46:31 - error: Unpack is not allowed in this context (reportInvalidTypeForm)'] +Line 54: Unexpected errors ['generics_typevartuple_variance.py:54:29 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues)'] +Line 65: Unexpected errors ['generics_typevartuple_variance.py:65:49 - error: Type "ContravariantTypeVarTupleOld[object]" is not assignable to declared type "ContravariantTypeVarTupleOld[int]"'] +Line 68: Unexpected errors ['generics_typevartuple_variance.py:68:31 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues)'] +Line 79: Unexpected errors ['generics_typevartuple_variance.py:79:49 - error: Type "CovariantTypeVarTupleOld[int]" is not assignable to declared type "CovariantTypeVarTupleOld[object]"'] +""" +output = """ +generics_typevartuple_variance.py:14:45 - error: Type "InvariantTypeVarTuple[int]" is not assignable to declared type "InvariantTypeVarTuple[object]" +  "InvariantTypeVarTuple[int]" is not assignable to "InvariantTypeVarTuple[object]" +    Type parameter "InOutTs@InvariantTypeVarTuple" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +generics_typevartuple_variance.py:15:42 - error: Type "InvariantTypeVarTuple[object]" is not assignable to declared type "InvariantTypeVarTuple[int]" +  "InvariantTypeVarTuple[object]" is not assignable to "InvariantTypeVarTuple[int]" +    Type parameter "InOutTs@InvariantTypeVarTuple" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:23:53 - error: Type "ContravariantTypeVarTuple[int]" is not assignable to declared type "ContravariantTypeVarTuple[object, object]" +  "ContravariantTypeVarTuple[int]" is not assignable to "ContravariantTypeVarTuple[object, object]" +    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[int]" is not the same as "*tuple[object, object]" (reportAssignmentType) +generics_typevartuple_variance.py:24:42 - error: Type "ContravariantTypeVarTuple[object]" is not assignable to declared type "ContravariantTypeVarTuple[int]" +  "ContravariantTypeVarTuple[object]" is not assignable to "ContravariantTypeVarTuple[int]" +    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:32:39 - error: Type "CovariantTypeVarTuple[object]" is not assignable to declared type "CovariantTypeVarTuple[int]" +  "CovariantTypeVarTuple[object]" is not assignable to "CovariantTypeVarTuple[int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:33:42 - error: Type "CovariantTypeVarTuple[int]" is not assignable to declared type "CovariantTypeVarTuple[object]" +  "CovariantTypeVarTuple[int]" is not assignable to "CovariantTypeVarTuple[object]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +generics_typevartuple_variance.py:34:54 - error: Type "CovariantTypeVarTuple[int, int]" is not assignable to declared type "CovariantTypeVarTuple[float, float]" +  "CovariantTypeVarTuple[int, int]" is not assignable to "CovariantTypeVarTuple[float, float]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[int, int]" is not the same as "*tuple[float, float]" (reportAssignmentType) +generics_typevartuple_variance.py:35:54 - error: Type "CovariantTypeVarTuple[int, object]" is not assignable to declared type "CovariantTypeVarTuple[float, float]" +  "CovariantTypeVarTuple[int, object]" is not assignable to "CovariantTypeVarTuple[float, float]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[int, object]" is not the same as "*tuple[float, float]" (reportAssignmentType) +generics_typevartuple_variance.py:36:54 - error: Type "CovariantTypeVarTuple[object, int]" is not assignable to declared type "CovariantTypeVarTuple[float, float]" +  "CovariantTypeVarTuple[object, int]" is not assignable to "CovariantTypeVarTuple[float, float]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object, int]" is not the same as "*tuple[float, float]" (reportAssignmentType) +generics_typevartuple_variance.py:37:54 - error: Type "CovariantTypeVarTuple[object, object]" is not assignable to declared type "CovariantTypeVarTuple[float, float]" +  "CovariantTypeVarTuple[object, object]" is not assignable to "CovariantTypeVarTuple[float, float]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object, object]" is not the same as "*tuple[float, float]" (reportAssignmentType) +generics_typevartuple_variance.py:43:27 - error: Unpack operator not allowed in type expression (reportInvalidTypeForm) +generics_typevartuple_variance.py:43:28 - error: "InTs" is not defined (reportUndefinedVariable) +generics_typevartuple_variance.py:46:31 - error: "InTs" is not defined (reportUndefinedVariable) +generics_typevartuple_variance.py:46:31 - error: Unpack is not allowed in this context (reportInvalidTypeForm) +generics_typevartuple_variance.py:50:45 - error: Type "InvariantTypeVarTupleOld[int]" is not assignable to declared type "InvariantTypeVarTupleOld[object]" +  "InvariantTypeVarTupleOld[int]" is not assignable to "InvariantTypeVarTupleOld[object]" +    Type parameter "Ts@InvariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +generics_typevartuple_variance.py:51:42 - error: Type "InvariantTypeVarTupleOld[object]" is not assignable to declared type "InvariantTypeVarTupleOld[int]" +  "InvariantTypeVarTupleOld[object]" is not assignable to "InvariantTypeVarTupleOld[int]" +    Type parameter "Ts@InvariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:54:29 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:64:52 - error: Type "ContravariantTypeVarTupleOld[int]" is not assignable to declared type "ContravariantTypeVarTupleOld[object]" +  "ContravariantTypeVarTupleOld[int]" is not assignable to "ContravariantTypeVarTupleOld[object]" +    Type parameter "InTs@ContravariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +generics_typevartuple_variance.py:65:49 - error: Type "ContravariantTypeVarTupleOld[object]" is not assignable to declared type "ContravariantTypeVarTupleOld[int]" +  "ContravariantTypeVarTupleOld[object]" is not assignable to "ContravariantTypeVarTupleOld[int]" +    Type parameter "InTs@ContravariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:68:31 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:78:46 - error: Type "CovariantTypeVarTupleOld[object]" is not assignable to declared type "CovariantTypeVarTupleOld[int]" +  "CovariantTypeVarTupleOld[object]" is not assignable to "CovariantTypeVarTupleOld[int]" +    Type parameter "OutTs@CovariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_typevartuple_variance.py:79:49 - error: Type "CovariantTypeVarTupleOld[int]" is not assignable to declared type "CovariantTypeVarTupleOld[object]" +  "CovariantTypeVarTupleOld[int]" is not assignable to "CovariantTypeVarTupleOld[object]" +    Type parameter "OutTs@CovariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) +""" diff --git a/conformance/results/ty/generics_paramspec_variance.toml b/conformance/results/ty/generics_paramspec_variance.toml new file mode 100644 index 000000000..a36991df6 --- /dev/null +++ b/conformance/results/ty/generics_paramspec_variance.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not error when a ParamSpec is used in a position that violates its explicit variance. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 40: Expected 1 errors +Line 51: Expected 1 errors +""" +output = """ +generics_paramspec_variance.py:14:42: error[invalid-assignment] Object of type `InvariantParamSpec[(int, /)]` is not assignable to `InvariantParamSpec[(object, /)]` +generics_paramspec_variance.py:15:39: error[invalid-assignment] Object of type `InvariantParamSpec[(object, /)]` is not assignable to `InvariantParamSpec[(int, /)]` +generics_paramspec_variance.py:21:42: error[invalid-assignment] Object of type `ContravariantParamSpec[(int, /)]` is not assignable to `ContravariantParamSpec[(object, /)]` +generics_paramspec_variance.py:30:36: error[invalid-assignment] Object of type `CovariantParamSpec[(object, /)]` is not assignable to `CovariantParamSpec[(int, /)]` +generics_paramspec_variance.py:44:49: error[invalid-assignment] Object of type `ContravariantParamSpecOld[(int, /)]` is not assignable to `ContravariantParamSpecOld[(object, /)]` +generics_paramspec_variance.py:57:43: error[invalid-assignment] Object of type `CovariantParamSpecOld[(object, /)]` is not assignable to `CovariantParamSpecOld[(int, /)]` +""" diff --git a/conformance/results/ty/generics_typevartuple_basic.toml b/conformance/results/ty/generics_typevartuple_basic.toml index 7fd82253b..8b639ec3f 100644 --- a/conformance/results/ty/generics_typevartuple_basic.toml +++ b/conformance/results/ty/generics_typevartuple_basic.toml @@ -1,15 +1,15 @@ conformance_automated = "Pass" +conformant = "Partial" errors_diff = """ """ output = """ -generics_typevartuple_basic.py:42:34: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Height, Width]`, found `Height` -generics_typevartuple_basic.py:43:41: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Batch, Height, Width]`, found `tuple[Batch, Width]` -generics_typevartuple_basic.py:44:41: error[invalid-assignment] Object of type `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` -generics_typevartuple_basic.py:52:14: error[invalid-generic-class] `TypeVarTuple` must be unpacked with `*` or `Unpack[]` when used as an argument to `Generic` -generics_typevartuple_basic.py:53:37: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation -generics_typevartuple_basic.py:56:34: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a return type annotation -generics_typevartuple_basic.py:59:24: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation -generics_typevartuple_basic.py:65:27: error[invalid-legacy-type-variable] The `covariant` parameter of `typing.TypeVarTuple` was added in Python 3.15 +generics_typevartuple_basic.py:43:34: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Height, Width]`, found `Height` +generics_typevartuple_basic.py:44:41: error[invalid-argument-type] Argument to `Array.__init__` is incorrect: Expected `tuple[Batch, Height, Width]`, found `tuple[Batch, Width]` +generics_typevartuple_basic.py:45:41: error[invalid-assignment] Object of type `Array[Time, Batch, Width, Height]` is not assignable to `Array[Time, Batch, Height, Width]` +generics_typevartuple_basic.py:53:14: error[invalid-generic-class] `TypeVarTuple` must be unpacked with `*` or `Unpack[]` when used as an argument to `Generic` +generics_typevartuple_basic.py:54:37: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation +generics_typevartuple_basic.py:57:34: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a return type annotation +generics_typevartuple_basic.py:60:24: error[invalid-type-form] Bare TypeVarTuple `Shape` is not valid in this context in a parameter annotation generics_typevartuple_basic.py:66:7: error[invalid-legacy-type-variable] `TypeVarTuple` can only have one positional argument generics_typevartuple_basic.py:67:27: error[invalid-legacy-type-variable] The `bound` parameter of `typing.TypeVarTuple` was added in Python 3.15 generics_typevartuple_basic.py:91:15: error[invalid-argument-type] Argument to function `func2` is incorrect: Expected `tuple[Literal[0], Literal[0]]`, found `tuple[Literal[0]]` @@ -17,4 +17,5 @@ generics_typevartuple_basic.py:100:14: error[invalid-argument-type] Argument to generics_typevartuple_basic.py:100:17: error[invalid-argument-type] Argument to function `multiply` is incorrect: Expected `Array[Height | Width]`, found `Array[Width]` generics_typevartuple_basic.py:101:17: error[invalid-argument-type] Argument to function `multiply` is incorrect: Expected `Array[Height]`, found `Array[Height, Width]` generics_typevartuple_basic.py:107:14: error[invalid-generic-class] Only one `TypeVarTuple` parameter is allowed in a `Generic` subscription +generics_typevartuple_basic.py:111:20: error[invalid-type-form] Generic class `Array4` cannot have multiple `TypeVarTuple` type parameters: `Ts2` is an additional TypeVarTuple """ diff --git a/conformance/results/ty/generics_typevartuple_variance.toml b/conformance/results/ty/generics_typevartuple_variance.toml new file mode 100644 index 000000000..600a25fd3 --- /dev/null +++ b/conformance/results/ty/generics_typevartuple_variance.toml @@ -0,0 +1,24 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 16: Expected 1 errors +Line 60: Expected 1 errors +Line 71: Expected 1 errors +Line 43: Unexpected errors ['generics_typevartuple_variance.py:43:28: error[unresolved-reference] Name `InTs` used when not defined'] +Line 46: Unexpected errors ['generics_typevartuple_variance.py:46:31: error[unresolved-reference] Name `InTs` used when not defined'] +""" +output = """ +generics_typevartuple_variance.py:14:45: error[invalid-assignment] Object of type `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[object]` +generics_typevartuple_variance.py:15:42: error[invalid-assignment] Object of type `InvariantTypeVarTuple[object]` is not assignable to `InvariantTypeVarTuple[int]` +generics_typevartuple_variance.py:23:53: error[invalid-assignment] Object of type `ContravariantTypeVarTuple[int]` is not assignable to `ContravariantTypeVarTuple[object, object]` +generics_typevartuple_variance.py:32:39: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` +generics_typevartuple_variance.py:35:54: error[invalid-assignment] Object of type `CovariantTypeVarTuple[int, object]` is not assignable to `CovariantTypeVarTuple[int | float, int | float]` +generics_typevartuple_variance.py:36:54: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object, int]` is not assignable to `CovariantTypeVarTuple[int | float, int | float]` +generics_typevartuple_variance.py:37:54: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object, object]` is not assignable to `CovariantTypeVarTuple[int | float, int | float]` +generics_typevartuple_variance.py:43:28: error[unresolved-reference] Name `InTs` used when not defined +generics_typevartuple_variance.py:46:31: error[unresolved-reference] Name `InTs` used when not defined +generics_typevartuple_variance.py:50:45: error[invalid-assignment] Object of type `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` +generics_typevartuple_variance.py:51:42: error[invalid-assignment] Object of type `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` +generics_typevartuple_variance.py:64:52: error[invalid-assignment] Object of type `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` +generics_typevartuple_variance.py:78:46: error[invalid-assignment] Object of type `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` +""" diff --git a/conformance/results/zuban/generics_paramspec_variance.toml b/conformance/results/zuban/generics_paramspec_variance.toml new file mode 100644 index 000000000..78fb77e60 --- /dev/null +++ b/conformance/results/zuban/generics_paramspec_variance.toml @@ -0,0 +1,22 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 30: Expected 1 errors +Line 40: Expected 1 errors +Line 51: Expected 1 errors +Line 57: Expected 1 errors +Line 31: Unexpected errors ['generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment]'] +Line 33: Unexpected errors ['generics_paramspec_variance.py:33: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 47: Unexpected errors ['generics_paramspec_variance.py:47: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 58: Unexpected errors ['generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]'] +""" +output = """ +generics_paramspec_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantParamSpec[[int]]", variable has type "InvariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:21: error: Incompatible types in assignment (expression has type "ContravariantParamSpec[[int]]", variable has type "ContravariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment] +generics_paramspec_variance.py:33: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:44: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:47: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment] +""" diff --git a/conformance/results/zuban/generics_typevartuple_basic.toml b/conformance/results/zuban/generics_typevartuple_basic.toml index ca0cca722..b9ffa1e5a 100644 --- a/conformance/results/zuban/generics_typevartuple_basic.toml +++ b/conformance/results/zuban/generics_typevartuple_basic.toml @@ -2,18 +2,18 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -generics_typevartuple_basic.py:42: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" [arg-type] -generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" [arg-type] -generics_typevartuple_basic.py:45: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type] -generics_typevartuple_basic.py:52: error: Free type variable expected in Generic[...] [misc] -generics_typevartuple_basic.py:53: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:56: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] -generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_basic.py:43: error: Argument 1 to "Array" has incompatible type "Height"; expected "tuple[Height, Width]" [arg-type] +generics_typevartuple_basic.py:44: error: Argument 1 to "Array" has incompatible type "tuple[Batch, Width]"; expected "tuple[Batch, Height, Width]" [arg-type] +generics_typevartuple_basic.py:46: error: Argument 1 to "Array" has incompatible type "tuple[Time, Batch, Width, Height]"; expected "tuple[Time, Batch, Height, Width]" [arg-type] +generics_typevartuple_basic.py:53: error: Free type variable expected in Generic[...] [misc] +generics_typevartuple_basic.py:54: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:57: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] +generics_typevartuple_basic.py:60: error: TypeVarTuple "Shape" is only valid with an unpack [valid-type] generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" [call-arg] generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" [call-arg] generics_typevartuple_basic.py:91: error: Argument 2 to "func2" has incompatible type "tuple[int]"; expected "tuple[int, int]" [arg-type] generics_typevartuple_basic.py:100: error: Argument 2 to "multiply" has incompatible type "Array[Width]"; expected "Array[Height]" [arg-type] generics_typevartuple_basic.py:101: error: Argument 2 to "multiply" has incompatible type "Array[Height, Width]"; expected "Array[Height]" [arg-type] generics_typevartuple_basic.py:107: error: Can only use one type var tuple in a class def [misc] +generics_typevartuple_basic.py:111: error: Can only use one TypeVarTuple in type params [misc] """ diff --git a/conformance/results/zuban/generics_typevartuple_variance.toml b/conformance/results/zuban/generics_typevartuple_variance.toml new file mode 100644 index 000000000..5450e51ee --- /dev/null +++ b/conformance/results/zuban/generics_typevartuple_variance.toml @@ -0,0 +1,34 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 16: Expected 1 errors +Line 60: Expected 1 errors +Line 71: Expected 1 errors +Line 24: Unexpected errors ['generics_typevartuple_variance.py:24: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] +Line 33: Unexpected errors ['generics_typevartuple_variance.py:33: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[object]") [assignment]'] +Line 34: Unexpected errors ['generics_typevartuple_variance.py:34: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int, int]", variable has type "CovariantTypeVarTuple[float, float]") [assignment]'] +Line 54: Unexpected errors ['generics_typevartuple_variance.py:54: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg]'] +Line 65: Unexpected errors ['generics_typevartuple_variance.py:65: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment]'] +Line 68: Unexpected errors ['generics_typevartuple_variance.py:68: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg]'] +Line 79: Unexpected errors ['generics_typevartuple_variance.py:79: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[int]", variable has type "CovariantTypeVarTupleOld[object]") [assignment]'] +""" +output = """ +generics_typevartuple_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[int]", variable has type "InvariantTypeVarTuple[object]") [assignment] +generics_typevartuple_variance.py:15: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[object]", variable has type "InvariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:23: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[int]", variable has type "ContravariantTypeVarTuple[object, object]") [assignment] +generics_typevartuple_variance.py:24: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:32: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object]", variable has type "CovariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:33: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[object]") [assignment] +generics_typevartuple_variance.py:34: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int, int]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] +generics_typevartuple_variance.py:35: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int, object]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] +generics_typevartuple_variance.py:36: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, int]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] +generics_typevartuple_variance.py:37: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, object]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] +generics_typevartuple_variance.py:50: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[int]", variable has type "InvariantTypeVarTupleOld[object]") [assignment] +generics_typevartuple_variance.py:51: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[object]", variable has type "InvariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:54: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:64: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[int]", variable has type "ContravariantTypeVarTupleOld[object]") [assignment] +generics_typevartuple_variance.py:65: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:68: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:78: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[object]", variable has type "CovariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:79: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[int]", variable has type "CovariantTypeVarTupleOld[object]") [assignment] +""" diff --git a/conformance/tests/generics_paramspec_variance.py b/conformance/tests/generics_paramspec_variance.py new file mode 100644 index 000000000..67d31a0c9 --- /dev/null +++ b/conformance/tests/generics_paramspec_variance.py @@ -0,0 +1,58 @@ +""" +Tests variance of ParamSpec. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#semantics + + +from typing import Callable, Generic, ParamSpec + + +class InvariantParamSpec[**InOutP]: + a: Callable[InOutP, None] + +in_out_obj: InvariantParamSpec[object] = InvariantParamSpec[int]() # E +in_out_int: InvariantParamSpec[int] = InvariantParamSpec[object]() # E + + +class ContravariantParamSpec[**InP]: + def f(self, *args: InP.args, **kwargs: InP.kwargs): ... + +in_obj: ContravariantParamSpec[object] = ContravariantParamSpec[int]() # E +in_int: ContravariantParamSpec[int] = ContravariantParamSpec[object]() # OK + + +class CovariantParamSpec[**OutP]: + def f(self, fn: Callable[OutP, None]) -> None: + raise NotImplementedError + + +out_int: CovariantParamSpec[int] = CovariantParamSpec[object]() # E +out_obj: CovariantParamSpec[object] = CovariantParamSpec[int]() # OK + +InP = ParamSpec("InP", contravariant=True) + + +class ContravariantParamSpecOld(Generic[InP]): + def in_f(self) -> Callable[InP, None]: # OK + raise NotImplementedError + + def out_f(self, fn: Callable[InP, None]) -> None: # E + raise NotImplementedError + + +in_obj_old: ContravariantParamSpecOld[object] = ContravariantParamSpecOld[int]() # E +in_int_old: ContravariantParamSpecOld[int] = ContravariantParamSpecOld[object]() # OK + +OutP = ParamSpec("OutP", covariant=True) + + +class CovariantParamSpecOld(Generic[OutP]): + def in_f(self) -> Callable[OutP, None]: # E + raise NotImplementedError + def out_f(self, fn: Callable[OutP, None]) -> None: # OK + raise NotImplementedError + + +out_int_old: CovariantParamSpecOld[int] = CovariantParamSpecOld[object]() # E +out_obj_old: CovariantParamSpecOld[object] = CovariantParamSpecOld[int]() # OK diff --git a/conformance/tests/generics_typevartuple_basic.py b/conformance/tests/generics_typevartuple_basic.py index 47b493ff0..20dd6fdbf 100644 --- a/conformance/tests/generics_typevartuple_basic.py +++ b/conformance/tests/generics_typevartuple_basic.py @@ -7,6 +7,7 @@ from typing import Generic, NewType, TypeVarTuple, assert_type Ts = TypeVarTuple("Ts") +Ts1 = TypeVarTuple("Ts1") class Array1(Generic[*Ts]): @@ -60,9 +61,8 @@ def method1(*args: Shape) -> None: # E: not unpacked ... -# > TypeVarTuple does not yet support specification of variance, bounds, constraints. +# > TypeVarTuple does not yet support specification of bounds, constraints. -Ts1 = TypeVarTuple("Ts1", covariant=True) # E Ts2 = TypeVarTuple("Ts2", int, float) # E Ts3 = TypeVarTuple("Ts3", bound=int) # E @@ -104,5 +104,9 @@ def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): # > Only a single type variable tuple may appear in a type parameter list. -class Array3(Generic[*Ts1, *Ts2]): # E +class Array3(Generic[*Ts, *Ts1]): # E + ... + + +class Array4[*Ts1, *Ts2]: # E ... diff --git a/conformance/tests/generics_typevartuple_variance.py b/conformance/tests/generics_typevartuple_variance.py new file mode 100644 index 000000000..e410118f4 --- /dev/null +++ b/conformance/tests/generics_typevartuple_variance.py @@ -0,0 +1,79 @@ +""" +Tests variance of TypeVarTuple. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#semantics + + +from typing import Generic +from typing_extensions import TypeVarTuple + +class InvariantTypeVarTuple[*InOutTs]: + a: tuple[*InOutTs] + +in_out_obj: InvariantTypeVarTuple[object] = InvariantTypeVarTuple[int]() # E +in_out_int: InvariantTypeVarTuple[int] = InvariantTypeVarTuple[object]() # E +in_out_int = InvariantTypeVarTuple[int]() # E + + +class ContravariantTypeVarTuple[*InTs]: + def f(self, t: tuple[*InTs]): + raise NotImplementedError + +in_obj: ContravariantTypeVarTuple[object, object] = ContravariantTypeVarTuple[int]() # E +in_int: ContravariantTypeVarTuple[int] = ContravariantTypeVarTuple[object]() # OK + + +class CovariantTypeVarTuple[*OutTs]: + def f(self) -> tuple[*OutTs]: + raise NotImplementedError + + +out_int: CovariantTypeVarTuple[int] = CovariantTypeVarTuple[object]() # E +out_obj: CovariantTypeVarTuple[object] = CovariantTypeVarTuple[int]() # OK +out_multiple1: CovariantTypeVarTuple[float, float] = CovariantTypeVarTuple[int, int]() # OK +out_multiple2: CovariantTypeVarTuple[float, float] = CovariantTypeVarTuple[int, object]() # E +out_multiple3: CovariantTypeVarTuple[float, float] = CovariantTypeVarTuple[object, int]() # E +out_multiple4: CovariantTypeVarTuple[float, float] = CovariantTypeVarTuple[object, object]() # E + + +Ts = TypeVarTuple("Ts") + +class InvariantTypeVarTupleOld(Generic[*Ts]): + def in_f(self, *args: *InTs) -> None: # OK + raise NotImplementedError + + def out_f(self) -> tuple[*InTs]: # OK + raise NotImplementedError + + +obj_old: InvariantTypeVarTupleOld[object] = InvariantTypeVarTupleOld[int]() # E +int_old: InvariantTypeVarTupleOld[int] = InvariantTypeVarTupleOld[object]() # E + + +InTs = TypeVarTuple("InTs", contravariant=True) + +class ContravariantTypeVarTupleOld(Generic[*InTs]): + def in_f(self, *args: *InTs) -> None: # OK + raise NotImplementedError + + def out_f(self) -> tuple[*InTs]: # E + raise NotImplementedError + + +in_obj_old: ContravariantTypeVarTupleOld[object] = ContravariantTypeVarTupleOld[int]() # E +in_int_old: ContravariantTypeVarTupleOld[int] = ContravariantTypeVarTupleOld[object]() # OK + + +OutTs = TypeVarTuple("OutTs", covariant=True) + +class CovariantTypeVarTupleOld(Generic[*OutTs]): + def in_f(self, *args: *OutTs) -> None: # E + raise NotImplementedError + + def out_f(self) -> tuple[*OutTs]: # OK + raise NotImplementedError + + +out_int_old: CovariantTypeVarTupleOld[int] = CovariantTypeVarTupleOld[object]() # E +out_obj_old: CovariantTypeVarTupleOld[object] = CovariantTypeVarTupleOld[int]() # OK diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 7f6cbb925..088d8c892 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -678,8 +678,9 @@ Prior to 3.12, the ``ParamSpec`` constructor can be used. P = ParamSpec("WrongName") # Rejected because P =/= WrongName The runtime should accept ``bound``\ s and ``covariant`` and ``contravariant`` -arguments in the declaration just as ``typing.TypeVar`` does, but for now we -will defer the standardization of the semantics of those options to a later PEP. +arguments in the declaration just as ``typing.TypeVar`` does. + +We defer the standardization of the semantics of the ``bound`` option to a later PEP. .. _`paramspec_valid_use_locations`: @@ -1189,12 +1190,11 @@ for two reasons: * To improve readability: the star also functions as an explicit visual indicator that the type variable tuple is not a normal type variable. -Variance, Type Constraints and Type Bounds: Not Supported +Type Constraints and Type Bounds: Not Supported """"""""""""""""""""""""""""""""""""""""""""""""""""""""" ``TypeVarTuple`` does not currently support specification of: -* Variance (e.g. ``TypeVar('T', covariant=True)``) * Type constraints (``TypeVar('T', int, float)``) * Type bounds (``TypeVar('T', bound=ParentClass)``) @@ -2712,25 +2712,28 @@ The algorithm for computing the variance of a type parameter is as follows. For each type parameter in a generic class: -1. If the type parameter is variadic (``TypeVarTuple``) or a parameter -specification (``ParamSpec``), it is always considered invariant. No further -inference is needed. - -2. If the type parameter comes from a traditional ``TypeVar`` declaration and -is not specified as ``infer_variance`` (see below), its variance is specified -by the ``TypeVar`` constructor call. No further inference is needed. +1. If the type parameter comes from a traditional +``TypeVar``/``TypeVarTuple``/``ParamSpec`` declaration and is not constructed +with ``infer_variance=True`` (see below), its variance is specified by the +constructor call. No further inference is needed. -3. Create two specialized versions of the class. We'll refer to these as +2. Create two specialized versions of the class. We'll refer to these as ``upper`` and ``lower`` specializations. In both of these specializations, replace all type parameters other than the one being inferred by a dummy type instance (a concrete anonymous class that is assumed to meet the bounds or constraints of the type parameter). In the ``upper`` specialized class, -specialize the target type parameter with an ``object`` instance. This -specialization ignores the type parameter's upper bound or constraints. In the -``lower`` specialized class, specialize the target type parameter with itself -(i.e. the corresponding type argument is the type parameter itself). +specialize the target type parameter with: + +- an ``object`` instance for a type variable +- a ``*tuple[object, ...]`` value for a type variable tuple +- a "top signature" value for a parameter specification, i.e. a type that + represents the super type of every possible signature. + +This specialization ignores the type parameter's upper bound or constraints. +In the ``lower`` specialized class, specialize the target type parameter with +itself (i.e. the corresponding type argument is the type parameter itself). -4. Determine whether ``lower`` can be assigned to ``upper`` using normal +3. Determine whether ``lower`` can be assigned to ``upper`` using normal assignability rules. If so, the target type parameter is covariant. If not, determine whether ``upper`` can be assigned to ``lower``. If so, the target type parameter is contravariant. If neither of these combinations are From 39c64a1cf10978e2cbce2c6ab700762fbc171eb9 Mon Sep 17 00:00:00 2001 From: kotlinisland <65446343+kotlinisland@users.noreply.github.com> Date: Fri, 7 Aug 2026 13:21:20 +1000 Subject: [PATCH 2/2] fixup! specify that type variable tuples and parameter specification should have variance --- .../basilisk/generics_paramspec_variance.toml | 26 -- .../basilisk/generics_typevartuple_basic.toml | 0 .../generics_typevartuple_variance.toml | 34 --- .../generics_mixed_variance_inference.toml | 9 + .../mypy/generics_paramspec_variance.toml | 58 ++++- .../mypy/generics_typevartuple_variance.toml | 51 ++-- .../results/mypy/protocols_variance.toml | 27 +- .../generics_mixed_variance_inference.toml | 20 ++ .../generics_paramspec_variance.toml | 40 ++- .../generics_typevartuple_basic.toml | 5 +- .../generics_typevartuple_variance.toml | 62 +++-- .../literals_parameterizations.toml | 2 +- .../pycroscope/protocols_variance.toml | 14 +- .../pycroscope/specialtypes_sentinels.toml | 4 +- .../generics_mixed_variance_inference.toml | 13 + .../pyrefly/generics_paramspec_variance.toml | 44 +++- .../generics_typevartuple_variance.toml | 65 +++-- .../results/pyrefly/protocols_variance.toml | 23 +- .../generics_mixed_variance_inference.toml | 24 ++ .../pyright/generics_paramspec_variance.toml | 66 ++++- .../generics_typevartuple_variance.toml | 103 +++++--- .../results/pyright/protocols_variance.toml | 27 +- conformance/results/results.html | 104 ++++++-- .../ty/generics_mixed_variance_inference.toml | 9 + .../ty/generics_paramspec_variance.toml | 31 ++- .../ty/generics_typevartuple_basic.toml | 2 +- .../ty/generics_typevartuple_variance.toml | 39 +-- .../results/ty/protocols_variance.toml | 14 +- .../ty/typeddicts_readonly_inheritance.toml | 2 + .../generics_mixed_variance_inference.toml | 11 + .../zuban/generics_paramspec_variance.toml | 44 +++- .../zuban/generics_typevartuple_variance.toml | 65 +++-- .../results/zuban/protocols_variance.toml | 26 +- .../generics_mixed_variance_inference.py | 21 ++ .../tests/generics_paramspec_variance.py | 72 +++++- .../tests/generics_typevartuple_variance.py | 34 ++- conformance/tests/protocols_variance.py | 5 +- conformance/uv.lock | 240 +++++++++--------- docs/spec/generics.rst | 5 +- 39 files changed, 949 insertions(+), 492 deletions(-) delete mode 100644 conformance/results/basilisk/generics_paramspec_variance.toml delete mode 100644 conformance/results/basilisk/generics_typevartuple_basic.toml delete mode 100644 conformance/results/basilisk/generics_typevartuple_variance.toml create mode 100644 conformance/results/mypy/generics_mixed_variance_inference.toml create mode 100644 conformance/results/pycroscope/generics_mixed_variance_inference.toml create mode 100644 conformance/results/pyrefly/generics_mixed_variance_inference.toml create mode 100644 conformance/results/pyright/generics_mixed_variance_inference.toml create mode 100644 conformance/results/ty/generics_mixed_variance_inference.toml create mode 100644 conformance/results/zuban/generics_mixed_variance_inference.toml create mode 100644 conformance/tests/generics_mixed_variance_inference.py diff --git a/conformance/results/basilisk/generics_paramspec_variance.toml b/conformance/results/basilisk/generics_paramspec_variance.toml deleted file mode 100644 index 8c3829208..000000000 --- a/conformance/results/basilisk/generics_paramspec_variance.toml +++ /dev/null @@ -1,26 +0,0 @@ -conformant = "Unsupported" -conformance_automated = "Fail" -errors_diff = """ -Line 40: Expected 1 errors -Line 51: Expected 1 errors -Line 22: Unexpected errors ['generics_paramspec_variance.py:22:1: error: Type `ContravariantParamSpec[object]` is not assignable to `ContravariantParamSpec[int]` (type parameter is invariant) [generics_variance_inference]'] -Line 31: Unexpected errors ['generics_paramspec_variance.py:31:1: error: Type `CovariantParamSpec[int]` is not assignable to `CovariantParamSpec[object]` (type parameter is invariant) [generics_variance_inference]'] -Line 33: Unexpected errors ['generics_paramspec_variance.py:33:7: error: `ParamSpec` `InP` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic]'] -Line 45: Unexpected errors ['generics_paramspec_variance.py:45:1: error: Type `ContravariantParamSpecOld[object]` is not assignable to `ContravariantParamSpecOld[int]` (type parameter is contravariant) [generics_variance_inference]'] -Line 47: Unexpected errors ['generics_paramspec_variance.py:47:8: error: `ParamSpec` `OutP` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic]'] -Line 58: Unexpected errors ['generics_paramspec_variance.py:58:1: error: Type `CovariantParamSpecOld[int]` is not assignable to `CovariantParamSpecOld[object]` (type parameter is covariant) [generics_variance_inference]'] -""" -output = """ -generics_paramspec_variance.py:14:1: error: Type `InvariantParamSpec[int]` is not assignable to `InvariantParamSpec[object]` (type parameter is invariant) [generics_variance_inference] -generics_paramspec_variance.py:15:1: error: Type `InvariantParamSpec[object]` is not assignable to `InvariantParamSpec[int]` (type parameter is invariant) [generics_variance_inference] -generics_paramspec_variance.py:21:1: error: Type `ContravariantParamSpec[int]` is not assignable to `ContravariantParamSpec[object]` (type parameter is invariant) [generics_variance_inference] -generics_paramspec_variance.py:22:1: error: Type `ContravariantParamSpec[object]` is not assignable to `ContravariantParamSpec[int]` (type parameter is invariant) [generics_variance_inference] -generics_paramspec_variance.py:30:1: error: Type `CovariantParamSpec[object]` is not assignable to `CovariantParamSpec[int]` (type parameter is invariant) [generics_variance_inference] -generics_paramspec_variance.py:31:1: error: Type `CovariantParamSpec[int]` is not assignable to `CovariantParamSpec[object]` (type parameter is invariant) [generics_variance_inference] -generics_paramspec_variance.py:33:7: error: `ParamSpec` `InP` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic] -generics_paramspec_variance.py:44:1: error: Type `ContravariantParamSpecOld[int]` is not assignable to `ContravariantParamSpecOld[object]` (type parameter is contravariant) [generics_variance_inference] -generics_paramspec_variance.py:45:1: error: Type `ContravariantParamSpecOld[object]` is not assignable to `ContravariantParamSpecOld[int]` (type parameter is contravariant) [generics_variance_inference] -generics_paramspec_variance.py:47:8: error: `ParamSpec` `OutP` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic] -generics_paramspec_variance.py:57:1: error: Type `CovariantParamSpecOld[object]` is not assignable to `CovariantParamSpecOld[int]` (type parameter is covariant) [generics_variance_inference] -generics_paramspec_variance.py:58:1: error: Type `CovariantParamSpecOld[int]` is not assignable to `CovariantParamSpecOld[object]` (type parameter is covariant) [generics_variance_inference] -""" diff --git a/conformance/results/basilisk/generics_typevartuple_basic.toml b/conformance/results/basilisk/generics_typevartuple_basic.toml deleted file mode 100644 index e69de29bb..000000000 diff --git a/conformance/results/basilisk/generics_typevartuple_variance.toml b/conformance/results/basilisk/generics_typevartuple_variance.toml deleted file mode 100644 index c26f5e4e9..000000000 --- a/conformance/results/basilisk/generics_typevartuple_variance.toml +++ /dev/null @@ -1,34 +0,0 @@ -conformant = "Unsupported" -conformance_automated = "Fail" -errors_diff = """ -Line 16: Expected 1 errors -Line 35: Expected 1 errors -Line 60: Expected 1 errors -Line 71: Expected 1 errors -Line 24: Unexpected errors ['generics_typevartuple_variance.py:24:1: error: Type `ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` (type parameter is contravariant) [generics_variance_inference]'] -Line 33: Unexpected errors ['generics_typevartuple_variance.py:33:1: error: Type `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` (type parameter is covariant) [generics_variance_inference]'] -Line 54: Unexpected errors ['generics_typevartuple_variance.py:54:8: error: `TypeVarTuple` `InTs` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic]', 'generics_typevartuple_variance.py:54:8: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support variance specification [generics_typevartuple_basic_3]'] -Line 65: Unexpected errors ['generics_typevartuple_variance.py:65:1: error: Type `ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` (type parameter is contravariant) [generics_variance_inference]'] -Line 68: Unexpected errors ['generics_typevartuple_variance.py:68:9: error: `TypeVarTuple` `OutTs` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic]', 'generics_typevartuple_variance.py:68:9: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support variance specification [generics_typevartuple_basic_3]'] -Line 79: Unexpected errors ['generics_typevartuple_variance.py:79:1: error: Type `CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` (type parameter is covariant) [generics_variance_inference]'] -""" -output = """ -generics_typevartuple_variance.py:14:1: error: Type `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[object]` (type parameter is invariant) [generics_variance_inference] -generics_typevartuple_variance.py:15:1: error: Type `InvariantTypeVarTuple[object]` is not assignable to `InvariantTypeVarTuple[int]` (type parameter is invariant) [generics_variance_inference] -generics_typevartuple_variance.py:23:1: error: Type `ContravariantTypeVarTuple[int]` is not assignable to `ContravariantTypeVarTuple[object]` (type parameter is contravariant) [generics_variance_inference] -generics_typevartuple_variance.py:24:1: error: Type `ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` (type parameter is contravariant) [generics_variance_inference] -generics_typevartuple_variance.py:32:1: error: Type `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` (type parameter is covariant) [generics_variance_inference] -generics_typevartuple_variance.py:33:1: error: Type `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` (type parameter is covariant) [generics_variance_inference] -generics_typevartuple_variance.py:36:1: error: Type `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[float]` (type parameter is covariant) [generics_variance_inference] -generics_typevartuple_variance.py:37:1: error: Type `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[float]` (type parameter is covariant) [generics_variance_inference] -generics_typevartuple_variance.py:50:1: error: Type `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` (type parameter is invariant) [generics_variance_inference] -generics_typevartuple_variance.py:51:1: error: Type `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` (type parameter is invariant) [generics_variance_inference] -generics_typevartuple_variance.py:54:8: error: `TypeVarTuple` `InTs` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic] -generics_typevartuple_variance.py:54:8: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support variance specification [generics_typevartuple_basic_3] -generics_typevartuple_variance.py:64:1: error: Type `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` (type parameter is contravariant) [generics_variance_inference] -generics_typevartuple_variance.py:65:1: error: Type `ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` (type parameter is contravariant) [generics_variance_inference] -generics_typevartuple_variance.py:68:9: error: `TypeVarTuple` `OutTs` does not support `covariant` or `contravariant` arguments [generics_typevartuple_basic] -generics_typevartuple_variance.py:68:9: error: Invalid `TypeVarTuple` parameters: `TypeVarTuple` does not support variance specification [generics_typevartuple_basic_3] -generics_typevartuple_variance.py:78:1: error: Type `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` (type parameter is covariant) [generics_variance_inference] -generics_typevartuple_variance.py:79:1: error: Type `CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` (type parameter is covariant) [generics_variance_inference] -""" diff --git a/conformance/results/mypy/generics_mixed_variance_inference.toml b/conformance/results/mypy/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..84f10eed9 --- /dev/null +++ b/conformance/results/mypy/generics_mixed_variance_inference.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_mixed_variance_inference.py:13: error: Incompatible types in assignment (expression has type "Mixed[bool, []]", variable has type "Mixed[int, []]") [assignment] +generics_mixed_variance_inference.py:16: error: Incompatible types in assignment (expression has type "Mixed[int, object, []]", variable has type "Mixed[int, int, []]") [assignment] +generics_mixed_variance_inference.py:21: error: Incompatible types in assignment (expression has type "Mixed[int, [bool]]", variable has type "Mixed[int, [int]]") [assignment] +""" diff --git a/conformance/results/mypy/generics_paramspec_variance.toml b/conformance/results/mypy/generics_paramspec_variance.toml index 78fb77e60..d6c507362 100644 --- a/conformance/results/mypy/generics_paramspec_variance.toml +++ b/conformance/results/mypy/generics_paramspec_variance.toml @@ -3,20 +3,58 @@ conformance_automated = "Fail" errors_diff = """ Line 15: Expected 1 errors Line 30: Expected 1 errors -Line 40: Expected 1 errors -Line 51: Expected 1 errors -Line 57: Expected 1 errors +Line 64: Expected 1 errors +Line 110: Expected 1 errors +Line 121: Expected 1 errors +Line 127: Expected 1 errors Line 31: Unexpected errors ['generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment]'] -Line 33: Unexpected errors ['generics_paramspec_variance.py:33: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] -Line 47: Unexpected errors ['generics_paramspec_variance.py:47: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] -Line 58: Unexpected errors ['generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]'] +Line 58: Unexpected errors ['generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "InitP[[NamedArg(int, \\'a\\')]]", variable has type "InitP[[int]]") [assignment]'] +Line 60: Unexpected errors ['generics_paramspec_variance.py:60: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[Arg(int, \\'a\\')]]") [assignment]'] +Line 76: Unexpected errors ['generics_paramspec_variance.py:76: error: Argument 1 to "Box" has incompatible type "OutitP[[int]]"; expected "InitP[[int]]" [arg-type]'] +Line 78: Unexpected errors ['generics_paramspec_variance.py:78: error: Incompatible types in assignment (expression has type "OutitP[[NamedArg(int, \\'a\\')]]", variable has type "InitP[[NamedArg(int, \\'a\\')]]") [assignment]'] +Line 80: Unexpected errors ['generics_paramspec_variance.py:80: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment]'] +Line 82: Unexpected errors ['generics_paramspec_variance.py:82: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment]'] +Line 83: Unexpected errors ['generics_paramspec_variance.py:83: error: Name "_" already defined on line 62 [no-redef]', 'generics_paramspec_variance.py:83: error: Invalid type comment or annotation [valid-type]'] +Line 84: Unexpected errors ['generics_paramspec_variance.py:84: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment]'] +Line 86: Unexpected errors ['generics_paramspec_variance.py:86: error: Incompatible types in assignment (expression has type "OutitP[[int, str]]", variable has type "InitP[[int, str]]") [assignment]'] +Line 91: Unexpected errors ['generics_paramspec_variance.py:91: error: String argument 1 "InP" to ParamSpec(...) does not match variable name "P" [misc]'] +Line 92: Unexpected errors ['generics_paramspec_variance.py:92: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 97: Unexpected errors ['generics_paramspec_variance.py:97: error: Free type variable expected in Generic[...] [misc]'] +Line 101: Unexpected errors ['generics_paramspec_variance.py:101: error: "InvariantParamSpecOld" expects no type arguments, but 1 given [type-arg]'] +Line 102: Unexpected errors ['generics_paramspec_variance.py:102: error: The type "type[InvariantParamSpecOld]" is not generic and not indexable [misc]'] +Line 117: Unexpected errors ['generics_paramspec_variance.py:117: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 128: Unexpected errors ['generics_paramspec_variance.py:128: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]'] """ output = """ generics_paramspec_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantParamSpec[[int]]", variable has type "InvariantParamSpec[[object]]") [assignment] generics_paramspec_variance.py:21: error: Incompatible types in assignment (expression has type "ContravariantParamSpec[[int]]", variable has type "ContravariantParamSpec[[object]]") [assignment] generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment] -generics_paramspec_variance.py:33: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] -generics_paramspec_variance.py:44: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment] -generics_paramspec_variance.py:47: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] -generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "InitP[[NamedArg(int, 'a')]]", variable has type "InitP[[int]]") [assignment] +generics_paramspec_variance.py:60: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[Arg(int, 'a')]]") [assignment] +generics_paramspec_variance.py:62: error: Invalid type comment or annotation [valid-type] +generics_paramspec_variance.py:66: error: Incompatible types in assignment (expression has type "InitP[[int, str]]", variable has type "InitP[[int]]") [assignment] +generics_paramspec_variance.py:76: error: Argument 1 to "Box" has incompatible type "OutitP[[int]]"; expected "InitP[[int]]" [arg-type] +generics_paramspec_variance.py:78: error: Incompatible types in assignment (expression has type "OutitP[[NamedArg(int, 'a')]]", variable has type "InitP[[NamedArg(int, 'a')]]") [assignment] +generics_paramspec_variance.py:79: error: Incompatible types in assignment (expression has type "InitP[[NamedArg(int, 'a')]]", variable has type "InitP[[int]]") [assignment] +generics_paramspec_variance.py:80: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment] +generics_paramspec_variance.py:81: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[Arg(int, 'a')]]") [assignment] +generics_paramspec_variance.py:82: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment] +generics_paramspec_variance.py:83: error: Name "_" already defined on line 62 [no-redef] +generics_paramspec_variance.py:83: error: Invalid type comment or annotation [valid-type] +generics_paramspec_variance.py:84: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "InitP[[int]]") [assignment] +generics_paramspec_variance.py:86: error: Incompatible types in assignment (expression has type "OutitP[[int, str]]", variable has type "InitP[[int, str]]") [assignment] +generics_paramspec_variance.py:87: error: Incompatible types in assignment (expression has type "InitP[[int, str]]", variable has type "InitP[[int]]") [assignment] +generics_paramspec_variance.py:91: error: String argument 1 "InP" to ParamSpec(...) does not match variable name "P" [misc] +generics_paramspec_variance.py:92: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:93: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:94: error: String argument 1 "InvP1" to ParamSpec(...) does not match variable name "InvP2" [misc] +generics_paramspec_variance.py:95: error: String argument 1 "InvP1" to ParamSpec(...) does not match variable name "InvP3" [misc] +generics_paramspec_variance.py:97: error: Free type variable expected in Generic[...] [misc] +generics_paramspec_variance.py:101: error: "InvariantParamSpecOld" expects no type arguments, but 1 given [type-arg] +generics_paramspec_variance.py:102: error: The type "type[InvariantParamSpecOld]" is not generic and not indexable [misc] +generics_paramspec_variance.py:103: error: The type "type[InvariantParamSpecOld]" is not generic and not indexable [misc] +generics_paramspec_variance.py:104: error: The type "type[InvariantParamSpecOld]" is not generic and not indexable [misc] +generics_paramspec_variance.py:114: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:117: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:128: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment] """ diff --git a/conformance/results/mypy/generics_typevartuple_variance.toml b/conformance/results/mypy/generics_typevartuple_variance.toml index 4a1bc2d81..ca2856d00 100644 --- a/conformance/results/mypy/generics_typevartuple_variance.toml +++ b/conformance/results/mypy/generics_typevartuple_variance.toml @@ -2,27 +2,38 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ Line 14: Expected 1 errors -Line 16: Expected 1 errors -Line 50: Expected 1 errors -Line 60: Expected 1 errors -Line 64: Expected 1 errors -Line 71: Expected 1 errors -Line 24: Unexpected errors ['generics_typevartuple_variance.py:24: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] -Line 54: Unexpected errors ['generics_typevartuple_variance.py:54: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc]'] -Line 65: Unexpected errors ['generics_typevartuple_variance.py:65: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment]'] -Line 68: Unexpected errors ['generics_typevartuple_variance.py:68: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc]'] +Line 18: Expected 1 errors +Line 26: Expected 1 errors +Line 29: Expected 1 errors +Line 61: Expected 1 errors +Line 72: Expected 1 errors +Line 76: Expected 1 errors +Line 83: Expected 1 errors +Line 27: Unexpected errors ['generics_typevartuple_variance.py:27: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] +Line 28: Unexpected errors ['generics_typevartuple_variance.py:28: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[*tuple[object, ...]]", variable has type "ContravariantTypeVarTuple[*tuple[int, ...]]") [assignment]'] +Line 66: Unexpected errors ['generics_typevartuple_variance.py:66: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc]'] +Line 77: Unexpected errors ['generics_typevartuple_variance.py:77: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment]'] +Line 80: Unexpected errors ['generics_typevartuple_variance.py:80: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc]'] """ output = """ generics_typevartuple_variance.py:15: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[object]", variable has type "InvariantTypeVarTuple[int]") [assignment] -generics_typevartuple_variance.py:23: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[int]", variable has type "ContravariantTypeVarTuple[object, object]") [assignment] -generics_typevartuple_variance.py:24: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment] -generics_typevartuple_variance.py:32: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object]", variable has type "CovariantTypeVarTuple[int]") [assignment] -generics_typevartuple_variance.py:35: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int, object]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] -generics_typevartuple_variance.py:36: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, int]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] -generics_typevartuple_variance.py:37: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, object]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] -generics_typevartuple_variance.py:51: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[object]", variable has type "InvariantTypeVarTupleOld[int]") [assignment] -generics_typevartuple_variance.py:54: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc] -generics_typevartuple_variance.py:65: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment] -generics_typevartuple_variance.py:68: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] -generics_typevartuple_variance.py:78: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[object]", variable has type "CovariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:17: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[*tuple[object, ...]]", variable has type "InvariantTypeVarTuple[*tuple[int, ...]]") [assignment] +generics_typevartuple_variance.py:27: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:28: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[*tuple[object, ...]]", variable has type "ContravariantTypeVarTuple[*tuple[int, ...]]") [assignment] +generics_typevartuple_variance.py:38: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object]", variable has type "CovariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:41: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, object]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:42: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:43: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, object]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:44: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[*tuple[object, ...]]", variable has type "CovariantTypeVarTuple[*tuple[int, ...]]") [assignment] +generics_typevartuple_variance.py:49: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:49: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:50: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:50: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:51: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:51: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:62: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[object]", variable has type "InvariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:66: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:77: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:80: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] +generics_typevartuple_variance.py:90: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[object]", variable has type "CovariantTypeVarTupleOld[int]") [assignment] """ diff --git a/conformance/results/mypy/protocols_variance.toml b/conformance/results/mypy/protocols_variance.toml index e434501cf..58d213901 100644 --- a/conformance/results/mypy/protocols_variance.toml +++ b/conformance/results/mypy/protocols_variance.toml @@ -1,15 +1,20 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +False report of ParamSpec variance keywords. +""" output = """ -protocols_variance.py:21: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] -protocols_variance.py:40: error: Invariant type variable "T3" used in protocol where contravariant one is expected [misc] -protocols_variance.py:56: error: Invariant type variable "T1" used in protocol where contravariant one is expected [misc] -protocols_variance.py:61: error: Covariant type variable "T1_co" used in protocol where contravariant one is expected [misc] -protocols_variance.py:62: error: Cannot use a covariant type variable as a parameter [misc] -protocols_variance.py:66: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] -protocols_variance.py:71: error: Contravariant type variable "T1_contra" used in protocol where covariant one is expected [misc] -protocols_variance.py:72: error: Cannot use a contravariant type variable as return type [misc] -protocols_variance.py:104: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] +protocols_variance.py:15: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +protocols_variance.py:22: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] +protocols_variance.py:41: error: Invariant type variable "T3" used in protocol where contravariant one is expected [misc] +protocols_variance.py:57: error: Invariant type variable "T1" used in protocol where contravariant one is expected [misc] +protocols_variance.py:62: error: Covariant type variable "T1_co" used in protocol where contravariant one is expected [misc] +protocols_variance.py:63: error: Cannot use a covariant type variable as a parameter [misc] +protocols_variance.py:67: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] +protocols_variance.py:72: error: Contravariant type variable "T1_contra" used in protocol where covariant one is expected [misc] +protocols_variance.py:73: error: Cannot use a contravariant type variable as return type [misc] +protocols_variance.py:105: error: Invariant type variable "T1" used in protocol where covariant one is expected [misc] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 15: Unexpected errors ['protocols_variance.py:15: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] """ diff --git a/conformance/results/pycroscope/generics_mixed_variance_inference.toml b/conformance/results/pycroscope/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..6aa55eb89 --- /dev/null +++ b/conformance/results/pycroscope/generics_mixed_variance_inference.toml @@ -0,0 +1,20 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 8: Unexpected errors ['./generics_mixed_variance_inference.py:8:32: Traceback (most recent call last):', './generics_mixed_variance_inference.py:8:4: Traceback (most recent call last):'] +Line 12: Unexpected errors ['./generics_mixed_variance_inference.py:12:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, Any[error]], got generics_mixed_variance_inference.Mixed[object, AnySig()] [incompatible_assignment]', './generics_mixed_variance_inference.py:12:4: Invalid type annotation [] [invalid_annotation]'] +Line 17: Unexpected errors ['./generics_mixed_variance_inference.py:17:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, int, ], got generics_mixed_variance_inference.Mixed[int, bool, AnySig()] [incompatible_assignment]'] +Line 20: Unexpected errors ["./generics_mixed_variance_inference.py:20:4: Invalid type annotation [] [invalid_annotation]"] +""" +output = """ +./generics_mixed_variance_inference.py:8:32: Traceback (most recent call last): +./generics_mixed_variance_inference.py:8:4: Traceback (most recent call last): +./generics_mixed_variance_inference.py:12:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, Any[error]], got generics_mixed_variance_inference.Mixed[object, AnySig()] [incompatible_assignment] +./generics_mixed_variance_inference.py:12:4: Invalid type annotation [] [invalid_annotation] +./generics_mixed_variance_inference.py:13:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, Any[error]], got generics_mixed_variance_inference.Mixed[bool, AnySig()] [incompatible_assignment] +./generics_mixed_variance_inference.py:13:4: Invalid type annotation [] [invalid_annotation] +./generics_mixed_variance_inference.py:16:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, int, ], got generics_mixed_variance_inference.Mixed[int, object, AnySig()] [incompatible_assignment] +./generics_mixed_variance_inference.py:17:0: Incompatible assignment: expected generics_mixed_variance_inference.Mixed[int, int, ], got generics_mixed_variance_inference.Mixed[int, bool, AnySig()] [incompatible_assignment] +./generics_mixed_variance_inference.py:20:4: Invalid type annotation [] [invalid_annotation] +./generics_mixed_variance_inference.py:21:4: Invalid type annotation [] [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/generics_paramspec_variance.toml b/conformance/results/pycroscope/generics_paramspec_variance.toml index df399c3f9..3e4872f89 100644 --- a/conformance/results/pycroscope/generics_paramspec_variance.toml +++ b/conformance/results/pycroscope/generics_paramspec_variance.toml @@ -1,13 +1,19 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ -Line 40: Expected 1 errors -Line 51: Expected 1 errors +Line 64: Expected 1 errors +Line 110: Expected 1 errors +Line 121: Expected 1 errors Line 19: Unexpected errors ['./generics_paramspec_variance.py:19:23: Traceback (most recent call last):', './generics_paramspec_variance.py:19:4: Traceback (most recent call last):'] Line 22: Unexpected errors ['./generics_paramspec_variance.py:22:38: Traceback (most recent call last):'] Line 31: Unexpected errors ['./generics_paramspec_variance.py:31:38: Traceback (most recent call last):'] -Line 45: Unexpected errors ['./generics_paramspec_variance.py:45:45: Traceback (most recent call last):'] -Line 58: Unexpected errors ['./generics_paramspec_variance.py:58:45: Traceback (most recent call last):'] +Line 58: Unexpected errors ["./generics_paramspec_variance.py:58:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(*, a: int) -> Any[unannotated]] [incompatible_assignment]"] +Line 60: Unexpected errors ["./generics_paramspec_variance.py:60:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(a: int, /) -> Any[unannotated]] [incompatible_assignment]"] +Line 83: Unexpected errors ['./generics_paramspec_variance.py:83:3: Traceback (most recent call last):', './generics_paramspec_variance.py:83:0: _ already declared [already_declared]'] +Line 91: Unexpected errors ["./generics_paramspec_variance.py:91:14: ParamSpec named 'InP' must be assigned to a variable with the same name [must_have_same_name]"] +Line 102: Unexpected errors ['./generics_paramspec_variance.py:102:13: Traceback (most recent call last):'] +Line 115: Unexpected errors ['./generics_paramspec_variance.py:115:45: Traceback (most recent call last):'] +Line 128: Unexpected errors ['./generics_paramspec_variance.py:128:45: Traceback (most recent call last):'] """ output = """ ./generics_paramspec_variance.py:14:41: Traceback (most recent call last): @@ -18,8 +24,26 @@ output = """ ./generics_paramspec_variance.py:22:38: Traceback (most recent call last): ./generics_paramspec_variance.py:30:35: Traceback (most recent call last): ./generics_paramspec_variance.py:31:38: Traceback (most recent call last): -./generics_paramspec_variance.py:44:48: Traceback (most recent call last): -./generics_paramspec_variance.py:45:45: Traceback (most recent call last): -./generics_paramspec_variance.py:57:42: Traceback (most recent call last): -./generics_paramspec_variance.py:58:45: Traceback (most recent call last): +./generics_paramspec_variance.py:58:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(*, a: int) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:60:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(a: int, /) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:62:3: Traceback (most recent call last): +./generics_paramspec_variance.py:66:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.InitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.InitP~[(a: int, b: str) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:79:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(*, a: int) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:81:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(a: int, /) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:83:3: Traceback (most recent call last): +./generics_paramspec_variance.py:83:0: _ already declared [already_declared] +./generics_paramspec_variance.py:87:0: Incompatible types in assignment to attribute 't': expected ./generics_paramspec_variance.py.OutitP~[(a: int) -> Any[unannotated]], got ./generics_paramspec_variance.py.OutitP~[(a: int, b: str) -> Any[unannotated]] [incompatible_assignment] +./generics_paramspec_variance.py:91:14: ParamSpec named 'InP' must be assigned to a variable with the same name [must_have_same_name] +./generics_paramspec_variance.py:93:8: Error calling (name: str, /, *, bound: object = no argument given, covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False], default: object = no argument given) -> typing.ParamSpec (with impl): Bivariant types are not supported. [incompatible_call] +./generics_paramspec_variance.py:94:8: Error calling (name: str, /, *, bound: object = no argument given, covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False], default: object = no argument given) -> typing.ParamSpec (with impl): Variance cannot be specified with infer_variance. [incompatible_call] +./generics_paramspec_variance.py:94:18: ParamSpec named 'InvP1' must be assigned to a variable with the same name [must_have_same_name] +./generics_paramspec_variance.py:95:8: Error calling (name: str, /, *, bound: object = no argument given, covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False], default: object = no argument given) -> typing.ParamSpec (with impl): Variance cannot be specified with infer_variance. [incompatible_call] +./generics_paramspec_variance.py:95:18: ParamSpec named 'InvP1' must be assigned to a variable with the same name [must_have_same_name] +./generics_paramspec_variance.py:102:13: Traceback (most recent call last): +./generics_paramspec_variance.py:103:13: Traceback (most recent call last): +./generics_paramspec_variance.py:104:13: Traceback (most recent call last): +./generics_paramspec_variance.py:114:48: Traceback (most recent call last): +./generics_paramspec_variance.py:115:45: Traceback (most recent call last): +./generics_paramspec_variance.py:127:42: Traceback (most recent call last): +./generics_paramspec_variance.py:128:45: Traceback (most recent call last): """ diff --git a/conformance/results/pycroscope/generics_typevartuple_basic.toml b/conformance/results/pycroscope/generics_typevartuple_basic.toml index ba2e31ecd..7438d8115 100644 --- a/conformance/results/pycroscope/generics_typevartuple_basic.toml +++ b/conformance/results/pycroscope/generics_typevartuple_basic.toml @@ -1,5 +1,8 @@ -conformant = "Unsupported" +conformant = "Partial" conformance_automated = "Fail" +notes = """ +doesn't error when there are multiple type var tuples in a definition +""" errors_diff = """ Line 111: Expected 1 errors """ diff --git a/conformance/results/pycroscope/generics_typevartuple_variance.toml b/conformance/results/pycroscope/generics_typevartuple_variance.toml index a7b0a2c61..7788ce48a 100644 --- a/conformance/results/pycroscope/generics_typevartuple_variance.toml +++ b/conformance/results/pycroscope/generics_typevartuple_variance.toml @@ -1,34 +1,40 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ -Line 16: Expected 1 errors -Line 60: Expected 1 errors -Line 71: Expected 1 errors -Line 24: Unexpected errors ['./generics_typevartuple_variance.py:24:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[int], got ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[object] [incompatible_assignment]'] -Line 33: Unexpected errors ['./generics_typevartuple_variance.py:33:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[object], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int] [incompatible_assignment]'] -Line 34: Unexpected errors ['./generics_typevartuple_variance.py:34:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[float | int, float | int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int, int] [incompatible_assignment]'] -Line 54: Unexpected errors ["./generics_typevartuple_variance.py:54:7: Error calling (name: str, /, *, default: TypeForm[object] = , bound: TypeForm[object] = , covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False]) -> typing_extensions.TypeVarTuple (with impl): TypeVarTuple.__new__() got an unexpected keyword argument 'contravariant' [incompatible_call]"] -Line 65: Unexpected errors ['./generics_typevartuple_variance.py:65:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[int], got ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[object] [incompatible_assignment]'] -Line 68: Unexpected errors ["./generics_typevartuple_variance.py:68:8: Error calling (name: str, /, *, default: TypeForm[object] = , bound: TypeForm[object] = , covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False]) -> typing_extensions.TypeVarTuple (with impl): TypeVarTuple.__new__() got an unexpected keyword argument 'covariant' [incompatible_call]"] -Line 79: Unexpected errors ['./generics_typevartuple_variance.py:79:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[object], got ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[int] [incompatible_assignment]'] +Line 49: Expected 1 errors +Line 50: Expected 1 errors +Line 51: Expected 1 errors +Line 72: Expected 1 errors +Line 83: Expected 1 errors +Line 27: Unexpected errors ['./generics_typevartuple_variance.py:27:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[int], got generics_typevartuple_variance.ContravariantTypeVarTuple[object] [incompatible_assignment]'] +Line 28: Unexpected errors ['./generics_typevartuple_variance.py:28:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment]'] +Line 39: Unexpected errors ['./generics_typevartuple_variance.py:39:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[object], got generics_typevartuple_variance.CovariantTypeVarTuple[int] [incompatible_assignment]'] +Line 40: Unexpected errors ['./generics_typevartuple_variance.py:40:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[bool, bool] [incompatible_assignment]'] +Line 45: Unexpected errors ['./generics_typevartuple_variance.py:45:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment]'] +Line 77: Unexpected errors ['./generics_typevartuple_variance.py:77:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTupleOld[int], got generics_typevartuple_variance.ContravariantTypeVarTupleOld[object] [incompatible_assignment]'] +Line 91: Unexpected errors ['./generics_typevartuple_variance.py:91:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTupleOld[object], got generics_typevartuple_variance.CovariantTypeVarTupleOld[int] [incompatible_assignment]'] """ output = """ -./generics_typevartuple_variance.py:14:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.InvariantTypeVarTuple[object], got ./generics_typevartuple_variance.py.InvariantTypeVarTuple[int] [incompatible_assignment] -./generics_typevartuple_variance.py:15:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.InvariantTypeVarTuple[int], got ./generics_typevartuple_variance.py.InvariantTypeVarTuple[object] [incompatible_assignment] -./generics_typevartuple_variance.py:23:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[object, object], got ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[int] [incompatible_assignment] -./generics_typevartuple_variance.py:24:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[int], got ./generics_typevartuple_variance.py.ContravariantTypeVarTuple[object] [incompatible_assignment] -./generics_typevartuple_variance.py:32:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[object] [incompatible_assignment] -./generics_typevartuple_variance.py:33:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[object], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int] [incompatible_assignment] -./generics_typevartuple_variance.py:34:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[float | int, float | int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int, int] [incompatible_assignment] -./generics_typevartuple_variance.py:35:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[float | int, float | int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[int, object] [incompatible_assignment] -./generics_typevartuple_variance.py:36:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[float | int, float | int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[object, int] [incompatible_assignment] -./generics_typevartuple_variance.py:37:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTuple[float | int, float | int], got ./generics_typevartuple_variance.py.CovariantTypeVarTuple[object, object] [incompatible_assignment] -./generics_typevartuple_variance.py:50:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.InvariantTypeVarTupleOld[object], got ./generics_typevartuple_variance.py.InvariantTypeVarTupleOld[int] [incompatible_assignment] -./generics_typevartuple_variance.py:51:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.InvariantTypeVarTupleOld[int], got ./generics_typevartuple_variance.py.InvariantTypeVarTupleOld[object] [incompatible_assignment] -./generics_typevartuple_variance.py:54:7: Error calling (name: str, /, *, default: TypeForm[object] = , bound: TypeForm[object] = , covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False]) -> typing_extensions.TypeVarTuple (with impl): TypeVarTuple.__new__() got an unexpected keyword argument 'contravariant' [incompatible_call] -./generics_typevartuple_variance.py:64:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[object], got ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[int] [incompatible_assignment] -./generics_typevartuple_variance.py:65:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[int], got ./generics_typevartuple_variance.py.ContravariantTypeVarTupleOld[object] [incompatible_assignment] -./generics_typevartuple_variance.py:68:8: Error calling (name: str, /, *, default: TypeForm[object] = , bound: TypeForm[object] = , covariant: bool = Literal[False], contravariant: bool = Literal[False], infer_variance: bool = Literal[False]) -> typing_extensions.TypeVarTuple (with impl): TypeVarTuple.__new__() got an unexpected keyword argument 'covariant' [incompatible_call] -./generics_typevartuple_variance.py:78:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[int], got ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[object] [incompatible_assignment] -./generics_typevartuple_variance.py:79:0: Incompatible assignment: expected ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[object], got ./generics_typevartuple_variance.py.CovariantTypeVarTupleOld[int] [incompatible_assignment] +./generics_typevartuple_variance.py:14:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[object], got generics_typevartuple_variance.InvariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:15:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[int], got generics_typevartuple_variance.InvariantTypeVarTuple[object] [incompatible_assignment] +./generics_typevartuple_variance.py:17:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.InvariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:18:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.InvariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:26:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[object, object], got generics_typevartuple_variance.ContravariantTypeVarTuple[object, int] [incompatible_assignment] +./generics_typevartuple_variance.py:27:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[int], got generics_typevartuple_variance.ContravariantTypeVarTuple[object] [incompatible_assignment] +./generics_typevartuple_variance.py:28:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:29:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.ContravariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:38:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int], got generics_typevartuple_variance.CovariantTypeVarTuple[object] [incompatible_assignment] +./generics_typevartuple_variance.py:39:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[object], got generics_typevartuple_variance.CovariantTypeVarTuple[int] [incompatible_assignment] +./generics_typevartuple_variance.py:40:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[bool, bool] [incompatible_assignment] +./generics_typevartuple_variance.py:41:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[bool, object] [incompatible_assignment] +./generics_typevartuple_variance.py:42:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[object, bool] [incompatible_assignment] +./generics_typevartuple_variance.py:43:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[int, int], got generics_typevartuple_variance.CovariantTypeVarTuple[object, object] [incompatible_assignment] +./generics_typevartuple_variance.py:44:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[int, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[object, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:45:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTuple[*tuple[object, ...]], got generics_typevartuple_variance.CovariantTypeVarTuple[tuple[int, ...]] [incompatible_assignment] +./generics_typevartuple_variance.py:61:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTupleOld[object], got generics_typevartuple_variance.InvariantTypeVarTupleOld[int] [incompatible_assignment] +./generics_typevartuple_variance.py:62:0: Incompatible assignment: expected generics_typevartuple_variance.InvariantTypeVarTupleOld[int], got generics_typevartuple_variance.InvariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:76:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTupleOld[object], got generics_typevartuple_variance.ContravariantTypeVarTupleOld[int] [incompatible_assignment] +./generics_typevartuple_variance.py:77:0: Incompatible assignment: expected generics_typevartuple_variance.ContravariantTypeVarTupleOld[int], got generics_typevartuple_variance.ContravariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:90:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTupleOld[int], got generics_typevartuple_variance.CovariantTypeVarTupleOld[object] [incompatible_assignment] +./generics_typevartuple_variance.py:91:0: Incompatible assignment: expected generics_typevartuple_variance.CovariantTypeVarTupleOld[object], got generics_typevartuple_variance.CovariantTypeVarTupleOld[int] [incompatible_assignment] """ diff --git a/conformance/results/pycroscope/literals_parameterizations.toml b/conformance/results/pycroscope/literals_parameterizations.toml index 80a88342d..d6be8e851 100644 --- a/conformance/results/pycroscope/literals_parameterizations.toml +++ b/conformance/results/pycroscope/literals_parameterizations.toml @@ -16,7 +16,7 @@ output = """ ./literals_parameterizations.py:43:6: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got (4+3j) [invalid_literal] ./literals_parameterizations.py:47:6: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got {'a': 'b', 'c': 'd'} [invalid_literal] ./literals_parameterizations.py:48:6: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got [invalid_literal] -./literals_parameterizations.py:50:7: Arguments to Literal[] must be literals, not (PartialCallValue(callee=KnownValue(val=), arguments={'name': KnownValue(val='T'), 'constraints': SequenceValue(typ=, literal_only=False, args=(MultiValuedValue(vals=()),), weak=True, members=()), 'bound': KnownValue(val=), 'covariant': KnownValue(val=False), 'contravariant': KnownValue(val=False), 'infer_variance': KnownValue(val=False), 'default': KnownValue(val=)}, runtime_value=TypedValue(typ=, literal_only=False), node=),) [invalid_literal] +./literals_parameterizations.py:50:7: Arguments to Literal[] must be literals, not (PartialCallValue(callee=KnownValue(val=), arguments={'name': KnownValue(val='T'), 'constraints': SequenceValue(typ=, literal_only=False, args=(MultiValuedValue(vals=()),), weak=True, members=()), 'bound': KnownValue(val=no argument given), 'covariant': KnownValue(val=False), 'contravariant': KnownValue(val=False), 'infer_variance': KnownValue(val=False), 'default': KnownValue(val=no argument given)}, runtime_value=TypedValue(typ=, literal_only=False), node=),) [invalid_literal] ./literals_parameterizations.py:50:15: Type parameter is not valid in this annotation context [invalid_annotation] ./literals_parameterizations.py:51:7: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got 3.14 [invalid_literal] ./literals_parameterizations.py:52:7: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got typing.Any [invalid_literal] diff --git a/conformance/results/pycroscope/protocols_variance.toml b/conformance/results/pycroscope/protocols_variance.toml index 70d6e1c4b..43efcf3a7 100644 --- a/conformance/results/pycroscope/protocols_variance.toml +++ b/conformance/results/pycroscope/protocols_variance.toml @@ -2,11 +2,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -./protocols_variance.py:21:0: T1 should be covariant [invalid_protocol] -./protocols_variance.py:40:0: T3 should be contravariant [invalid_protocol] -./protocols_variance.py:56:0: T1 should be contravariant [invalid_protocol] -./protocols_variance.py:61:0: T1_co should be contravariant [invalid_protocol] -./protocols_variance.py:66:0: T1 should be covariant [invalid_protocol] -./protocols_variance.py:71:0: T1_contra should be covariant [invalid_protocol] -./protocols_variance.py:104:0: T1 should be covariant [invalid_protocol] +./protocols_variance.py:22:0: T1 should be covariant [invalid_protocol] +./protocols_variance.py:41:0: T3 should be contravariant [invalid_protocol] +./protocols_variance.py:57:0: T1 should be contravariant [invalid_protocol] +./protocols_variance.py:62:0: T1_co should be contravariant [invalid_protocol] +./protocols_variance.py:67:0: T1 should be covariant [invalid_protocol] +./protocols_variance.py:72:0: T1_contra should be covariant [invalid_protocol] +./protocols_variance.py:105:0: T1 should be covariant [invalid_protocol] """ diff --git a/conformance/results/pycroscope/specialtypes_sentinels.toml b/conformance/results/pycroscope/specialtypes_sentinels.toml index 4c2425384..77f5d331c 100644 --- a/conformance/results/pycroscope/specialtypes_sentinels.toml +++ b/conformance/results/pycroscope/specialtypes_sentinels.toml @@ -3,6 +3,6 @@ errors_diff = """ """ output = """ ./specialtypes_sentinels.py:14:10: Default value for argument x incompatible with declared type int [incompatible_default] -./specialtypes_sentinels.py:36:6: Incompatible argument type for x: expected int | Literal[<>, ] but got [incompatible_argument] -./specialtypes_sentinels.py:39:6: Incompatible argument type for x: expected int | Literal[] but got <> [incompatible_argument] +./specialtypes_sentinels.py:36:6: Incompatible argument type for x: expected int | Literal[, SPECIAL] but got Cls.IN_CLASS [incompatible_argument] +./specialtypes_sentinels.py:39:6: Incompatible argument type for x: expected int | Literal[Cls.IN_CLASS] but got [incompatible_argument] """ diff --git a/conformance/results/pyrefly/generics_mixed_variance_inference.toml b/conformance/results/pyrefly/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..862cfd90f --- /dev/null +++ b/conformance/results/pyrefly/generics_mixed_variance_inference.toml @@ -0,0 +1,13 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Expected 1 errors +Line 17: Unexpected errors ['`Mixed[int, bool, []]` is not assignable to `Mixed[int, int, []]` [bad-assignment]'] +Line 20: Unexpected errors ['`Mixed[int, *tuple[()], [object]]` is not assignable to `Mixed[int, *tuple[()], [int]]` [bad-assignment]'] +""" +output = """ +ERROR generics_mixed_variance_inference.py:13:22-39: `Mixed[bool, *tuple[()], []]` is not assignable to `Mixed[int, *tuple[()], []]` [bad-assignment] +ERROR generics_mixed_variance_inference.py:16:27-51: `Mixed[int, object, []]` is not assignable to `Mixed[int, int, []]` [bad-assignment] +ERROR generics_mixed_variance_inference.py:17:27-49: `Mixed[int, bool, []]` is not assignable to `Mixed[int, int, []]` [bad-assignment] +ERROR generics_mixed_variance_inference.py:20:25-47: `Mixed[int, *tuple[()], [object]]` is not assignable to `Mixed[int, *tuple[()], [int]]` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/generics_paramspec_variance.toml b/conformance/results/pyrefly/generics_paramspec_variance.toml index 825a4504c..b04a2ded0 100644 --- a/conformance/results/pyrefly/generics_paramspec_variance.toml +++ b/conformance/results/pyrefly/generics_paramspec_variance.toml @@ -4,23 +4,43 @@ errors_diff = """ Line 14: Expected 1 errors Line 21: Expected 1 errors Line 30: Expected 1 errors -Line 40: Expected 1 errors -Line 51: Expected 1 errors +Line 110: Expected 1 errors +Line 121: Expected 1 errors Line 22: Unexpected errors ['`ContravariantParamSpec[[object]]` is not assignable to `ContravariantParamSpec[[int]]` [bad-assignment]'] Line 31: Unexpected errors ['`CovariantParamSpec[[int]]` is not assignable to `CovariantParamSpec[[object]]` [bad-assignment]'] -Line 33: Unexpected errors ['Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec]'] -Line 45: Unexpected errors ['`ContravariantParamSpecOld[[object]]` is not assignable to `ContravariantParamSpecOld[[int]]` [bad-assignment]'] -Line 47: Unexpected errors ['Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec]'] -Line 58: Unexpected errors ['`CovariantParamSpecOld[[int]]` is not assignable to `CovariantParamSpecOld[[object]]` [bad-assignment]'] +Line 83: Unexpected errors ['Function call cannot be used in annotations [invalid-annotation]'] +Line 91: Unexpected errors ['ParamSpec must be assigned to a variable named `InP` [invalid-param-spec]'] +Line 92: Unexpected errors ['Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec]'] +Line 115: Unexpected errors ['`ContravariantParamSpecOld[[object]]` is not assignable to `ContravariantParamSpecOld[[int]]` [bad-assignment]'] +Line 117: Unexpected errors ['Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec]'] +Line 128: Unexpected errors ['`CovariantParamSpecOld[[int]]` is not assignable to `CovariantParamSpecOld[[object]]` [bad-assignment]'] """ output = """ ERROR generics_paramspec_variance.py:15:39-67: `InvariantParamSpec[[object]]` is not assignable to `InvariantParamSpec[[int]]` [bad-assignment] ERROR generics_paramspec_variance.py:22:39-71: `ContravariantParamSpec[[object]]` is not assignable to `ContravariantParamSpec[[int]]` [bad-assignment] ERROR generics_paramspec_variance.py:31:39-64: `CovariantParamSpec[[int]]` is not assignable to `CovariantParamSpec[[object]]` [bad-assignment] -ERROR generics_paramspec_variance.py:33:24-42: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] -ERROR generics_paramspec_variance.py:44:49-81: `ContravariantParamSpecOld[[int]]` is not assignable to `ContravariantParamSpecOld[[object]]` [bad-assignment] -ERROR generics_paramspec_variance.py:45:46-81: `ContravariantParamSpecOld[[object]]` is not assignable to `ContravariantParamSpecOld[[int]]` [bad-assignment] -ERROR generics_paramspec_variance.py:47:26-40: Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec] -ERROR generics_paramspec_variance.py:57:43-74: `CovariantParamSpecOld[[object]]` is not assignable to `CovariantParamSpecOld[[int]]` [bad-assignment] -ERROR generics_paramspec_variance.py:58:46-74: `CovariantParamSpecOld[[int]]` is not assignable to `CovariantParamSpecOld[[object]]` [bad-assignment] +ERROR generics_paramspec_variance.py:62:4-16: Function call cannot be used in annotations [invalid-annotation] +ERROR generics_paramspec_variance.py:64:9-18: `InitP[[a: int = 1]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:66:9-16: `InitP[[a: int, b: str]]` is not assignable to attribute `t` with type `InitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:79:9-13: `OutitP[[*, a: int]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:81:9-14: `OutitP[[a: int, /]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:83:4-17: Function call cannot be used in annotations [invalid-annotation] +ERROR generics_paramspec_variance.py:87:9-16: `OutitP[[a: int, b: str]]` is not assignable to attribute `t` with type `OutitP[[a: int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:91:5-21: ParamSpec must be assigned to a variable named `InP` [invalid-param-spec] +ERROR generics_paramspec_variance.py:92:24-42: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:93:28-42: Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:93:44-62: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:94:9-64: ParamSpec must be assigned to a variable named `InvP1` [invalid-param-spec] +ERROR generics_paramspec_variance.py:94:28-42: Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:94:44-63: Unexpected keyword argument `infer_variance` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:95:9-68: ParamSpec must be assigned to a variable named `InvP1` [invalid-param-spec] +ERROR generics_paramspec_variance.py:95:28-46: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:95:48-67: Unexpected keyword argument `infer_variance` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:103:14-43: `InvariantParamSpecOld[[bool]]` is not assignable to variable `in_out_old` with type `InvariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:104:14-45: `InvariantParamSpecOld[[object]]` is not assignable to variable `in_out_old` with type `InvariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:114:49-81: `ContravariantParamSpecOld[[int]]` is not assignable to `ContravariantParamSpecOld[[object]]` [bad-assignment] +ERROR generics_paramspec_variance.py:115:46-81: `ContravariantParamSpecOld[[object]]` is not assignable to `ContravariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:117:26-40: Unexpected keyword argument `covariant` to ParamSpec [invalid-param-spec] +ERROR generics_paramspec_variance.py:127:43-74: `CovariantParamSpecOld[[object]]` is not assignable to `CovariantParamSpecOld[[int]]` [bad-assignment] +ERROR generics_paramspec_variance.py:128:46-74: `CovariantParamSpecOld[[int]]` is not assignable to `CovariantParamSpecOld[[object]]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_variance.toml b/conformance/results/pyrefly/generics_typevartuple_variance.toml index 5d23c0f1a..fb5185e8a 100644 --- a/conformance/results/pyrefly/generics_typevartuple_variance.toml +++ b/conformance/results/pyrefly/generics_typevartuple_variance.toml @@ -1,34 +1,47 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ -Line 16: Expected 1 errors -Line 60: Expected 1 errors -Line 71: Expected 1 errors -Line 24: Unexpected errors ['`ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment]'] -Line 33: Unexpected errors ['`CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` [bad-assignment]'] -Line 34: Unexpected errors ['`CovariantTypeVarTuple[int, int]` is not assignable to `CovariantTypeVarTuple[float, float]` [bad-assignment]'] -Line 54: Unexpected errors ['Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple]'] -Line 65: Unexpected errors ['`ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` [bad-assignment]'] -Line 68: Unexpected errors ['Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple]'] -Line 79: Unexpected errors ['`CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` [bad-assignment]'] +Line 72: Expected 1 errors +Line 83: Expected 1 errors +Line 27: Unexpected errors ['`ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment]'] +Line 28: Unexpected errors ['`ContravariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment]'] +Line 39: Unexpected errors ['`CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` [bad-assignment]'] +Line 40: Unexpected errors ['`CovariantTypeVarTuple[bool, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment]'] +Line 45: Unexpected errors ['`CovariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment]'] +Line 66: Unexpected errors ['Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple]'] +Line 77: Unexpected errors ['`ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` [bad-assignment]'] +Line 80: Unexpected errors ['Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple]'] +Line 91: Unexpected errors ['`CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` [bad-assignment]'] """ output = """ ERROR generics_typevartuple_variance.py:14:45-73: `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[object]` [bad-assignment] ERROR generics_typevartuple_variance.py:15:42-73: `InvariantTypeVarTuple[object]` is not assignable to `InvariantTypeVarTuple[int]` [bad-assignment] -ERROR generics_typevartuple_variance.py:23:53-85: `ContravariantTypeVarTuple[int]` is not assignable to `ContravariantTypeVarTuple[object, object]` [bad-assignment] -ERROR generics_typevartuple_variance.py:24:42-77: `ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment] -ERROR generics_typevartuple_variance.py:32:39-70: `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` [bad-assignment] -ERROR generics_typevartuple_variance.py:33:42-70: `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` [bad-assignment] -ERROR generics_typevartuple_variance.py:34:54-88: `CovariantTypeVarTuple[int, int]` is not assignable to `CovariantTypeVarTuple[float, float]` [bad-assignment] -ERROR generics_typevartuple_variance.py:35:54-91: `CovariantTypeVarTuple[int, object]` is not assignable to `CovariantTypeVarTuple[float, float]` [bad-assignment] -ERROR generics_typevartuple_variance.py:36:54-91: `CovariantTypeVarTuple[object, int]` is not assignable to `CovariantTypeVarTuple[float, float]` [bad-assignment] -ERROR generics_typevartuple_variance.py:37:54-94: `CovariantTypeVarTuple[object, object]` is not assignable to `CovariantTypeVarTuple[float, float]` [bad-assignment] -ERROR generics_typevartuple_variance.py:50:45-76: `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` [bad-assignment] -ERROR generics_typevartuple_variance.py:51:42-76: `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` [bad-assignment] -ERROR generics_typevartuple_variance.py:54:29-47: Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple] -ERROR generics_typevartuple_variance.py:64:52-87: `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` [bad-assignment] -ERROR generics_typevartuple_variance.py:65:49-87: `ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` [bad-assignment] -ERROR generics_typevartuple_variance.py:68:31-45: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] -ERROR generics_typevartuple_variance.py:78:46-80: `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` [bad-assignment] -ERROR generics_typevartuple_variance.py:79:49-80: `CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:17:64-108: `InvariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `InvariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:18:70-111: `InvariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `InvariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:26:53-93: `ContravariantTypeVarTuple[object, int]` is not assignable to `ContravariantTypeVarTuple[object, object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:27:42-77: `ContravariantTypeVarTuple[object]` is not assignable to `ContravariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:28:64-112: `ContravariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:29:70-115: `ContravariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:38:39-70: `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:39:42-70: `CovariantTypeVarTuple[int]` is not assignable to `CovariantTypeVarTuple[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:40:50-86: `CovariantTypeVarTuple[bool, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:41:50-88: `CovariantTypeVarTuple[bool, object]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:42:50-88: `CovariantTypeVarTuple[object, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:43:50-90: `CovariantTypeVarTuple[object, object]` is not assignable to `CovariantTypeVarTuple[int, int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:44:61-105: `CovariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[int, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:45:67-108: `CovariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[object, ...]]` [bad-assignment] +ERROR generics_typevartuple_variance.py:49:33-47: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:49:49-67: Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:50:33-47: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:50:49-68: Unexpected keyword argument `infer_variance` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:51:33-47: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:51:49-68: Unexpected keyword argument `infer_variance` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:61:45-76: `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:62:42-76: `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:66:29-47: Unexpected keyword argument `contravariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:76:52-87: `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` [bad-assignment] +ERROR generics_typevartuple_variance.py:77:49-87: `ContravariantTypeVarTupleOld[object]` is not assignable to `ContravariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:80:31-45: Unexpected keyword argument `covariant` to TypeVarTuple [invalid-type-var-tuple] +ERROR generics_typevartuple_variance.py:90:46-80: `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` [bad-assignment] +ERROR generics_typevartuple_variance.py:91:49-80: `CovariantTypeVarTupleOld[int]` is not assignable to `CovariantTypeVarTupleOld[object]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_variance.toml b/conformance/results/pyrefly/protocols_variance.toml index f0c9d08dc..f6836baf9 100644 --- a/conformance/results/pyrefly/protocols_variance.toml +++ b/conformance/results/pyrefly/protocols_variance.toml @@ -1,13 +1,18 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Partial" +conformance_automated = "Fail" +notes = """ +Doesn't support variance keywords to ParamSpec +""" errors_diff = """ +Line 15: Unexpected errors ['Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec]'] """ output = """ - WARN protocols_variance.py:21:7-17: Type variable `T1` in class `AnotherBox` is declared as invariant, but could be covariant based on its usage [variance-mismatch] - WARN protocols_variance.py:40:7-16: Type variable `T3` in class `Protocol2` is declared as invariant, but could be contravariant based on its usage [variance-mismatch] - WARN protocols_variance.py:56:7-16: Type variable `T1` in class `Protocol4` is declared as invariant, but could be contravariant based on its usage [variance-mismatch] -ERROR protocols_variance.py:62:9-11: Type variable `T1_co` is covariant but is used in contravariant position [invalid-variance] - WARN protocols_variance.py:66:7-16: Type variable `T1` in class `Protocol6` is declared as invariant, but could be covariant based on its usage [variance-mismatch] -ERROR protocols_variance.py:72:9-11: Type variable `T1_contra` is contravariant but is used in covariant position [invalid-variance] - WARN protocols_variance.py:104:7-17: Type variable `T1` in class `Protocol12` is declared as invariant, but could be covariant based on its usage [variance-mismatch] +ERROR protocols_variance.py:15:20-38: Unexpected keyword argument `contravariant` to ParamSpec [invalid-param-spec] + WARN protocols_variance.py:22:7-17: Type variable `T1` in class `AnotherBox` is declared as invariant, but could be covariant based on its usage [variance-mismatch] + WARN protocols_variance.py:41:7-16: Type variable `T3` in class `Protocol2` is declared as invariant, but could be contravariant based on its usage [variance-mismatch] + WARN protocols_variance.py:57:7-16: Type variable `T1` in class `Protocol4` is declared as invariant, but could be contravariant based on its usage [variance-mismatch] +ERROR protocols_variance.py:63:9-11: Type variable `T1_co` is covariant but is used in contravariant position [invalid-variance] + WARN protocols_variance.py:67:7-16: Type variable `T1` in class `Protocol6` is declared as invariant, but could be covariant based on its usage [variance-mismatch] +ERROR protocols_variance.py:73:9-11: Type variable `T1_contra` is contravariant but is used in covariant position [invalid-variance] + WARN protocols_variance.py:105:7-17: Type variable `T1` in class `Protocol12` is declared as invariant, but could be covariant based on its usage [variance-mismatch] """ diff --git a/conformance/results/pyright/generics_mixed_variance_inference.toml b/conformance/results/pyright/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..36e0b0436 --- /dev/null +++ b/conformance/results/pyright/generics_mixed_variance_inference.toml @@ -0,0 +1,24 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 17: Unexpected errors ['generics_mixed_variance_inference.py:17:27 - error: Type "Mixed[int, bool, ()]" is not assignable to declared type "Mixed[int, int, ()]"'] +Line 20: Unexpected errors ['generics_mixed_variance_inference.py:20:25 - error: Type "Mixed[int, (object)]" is not assignable to declared type "Mixed[int, (int)]"'] +""" +output = """ +generics_mixed_variance_inference.py:13:22 - error: Type "Mixed[bool, ()]" is not assignable to declared type "Mixed[int, ()]" +  "Mixed[bool, ()]" is not assignable to "Mixed[int, ()]" +    Type parameter "T@Mixed" is contravariant, but "bool" is not a supertype of "int" +      "int" is not assignable to "bool" (reportAssignmentType) +generics_mixed_variance_inference.py:16:27 - error: Type "Mixed[int, object, ()]" is not assignable to declared type "Mixed[int, int, ()]" +  "Mixed[int, object, ()]" is not assignable to "Mixed[int, int, ()]" +    Type parameter "Ts@Mixed" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_mixed_variance_inference.py:17:27 - error: Type "Mixed[int, bool, ()]" is not assignable to declared type "Mixed[int, int, ()]" +  "Mixed[int, bool, ()]" is not assignable to "Mixed[int, int, ()]" +    Type parameter "Ts@Mixed" is invariant, but "*tuple[bool]" is not the same as "*tuple[int]" (reportAssignmentType) +generics_mixed_variance_inference.py:20:25 - error: Type "Mixed[int, (object)]" is not assignable to declared type "Mixed[int, (int)]" +  "Mixed[int, (object)]" is not assignable to "Mixed[int, (int)]" +    Type parameter "P@Mixed" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_mixed_variance_inference.py:21:25 - error: Type "Mixed[int, (bool)]" is not assignable to declared type "Mixed[int, (int)]" +  "Mixed[int, (bool)]" is not assignable to "Mixed[int, (int)]" +    Type parameter "P@Mixed" is invariant, but "(bool)" is not the same as "(int)" (reportAssignmentType) +""" diff --git a/conformance/results/pyright/generics_paramspec_variance.toml b/conformance/results/pyright/generics_paramspec_variance.toml index a620f0588..8d1903d0b 100644 --- a/conformance/results/pyright/generics_paramspec_variance.toml +++ b/conformance/results/pyright/generics_paramspec_variance.toml @@ -1,14 +1,19 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ -Line 40: Expected 1 errors -Line 51: Expected 1 errors +Line 64: Expected 1 errors +Line 110: Expected 1 errors +Line 121: Expected 1 errors Line 22: Unexpected errors ['generics_paramspec_variance.py:22:39 - error: Type "ContravariantParamSpec[(object)]" is not assignable to declared type "ContravariantParamSpec[(int)]"'] Line 31: Unexpected errors ['generics_paramspec_variance.py:31:39 - error: Type "CovariantParamSpec[(int)]" is not assignable to declared type "CovariantParamSpec[(object)]"'] -Line 33: Unexpected errors ['generics_paramspec_variance.py:33:24 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] -Line 45: Unexpected errors ['generics_paramspec_variance.py:45:46 - error: Type "ContravariantParamSpecOld[(object)]" is not assignable to declared type "ContravariantParamSpecOld[(int)]"'] -Line 47: Unexpected errors ['generics_paramspec_variance.py:47:26 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] -Line 58: Unexpected errors ['generics_paramspec_variance.py:58:46 - error: Type "CovariantParamSpecOld[(int)]" is not assignable to declared type "CovariantParamSpecOld[(object)]"'] +Line 58: Unexpected errors ['generics_paramspec_variance.py:58:9 - error: Cannot assign to attribute "t" for class "Box[InitP[(a: int)]]"'] +Line 60: Unexpected errors ['generics_paramspec_variance.py:60:9 - error: Cannot assign to attribute "t" for class "Box[InitP[(a: int)]]"'] +Line 83: Unexpected errors ['generics_paramspec_variance.py:83:4 - error: Argument missing for parameter "fn" (reportCallIssue)', 'generics_paramspec_variance.py:83:4 - error: Call expression not allowed in type expression (reportInvalidTypeForm)'] +Line 91: Unexpected errors ['generics_paramspec_variance.py:91:1 - error: ParamSpec must be assigned to a variable named "InP" (reportGeneralTypeIssues)'] +Line 92: Unexpected errors ['generics_paramspec_variance.py:92:24 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] +Line 115: Unexpected errors ['generics_paramspec_variance.py:115:46 - error: Type "ContravariantParamSpecOld[(object)]" is not assignable to declared type "ContravariantParamSpecOld[(int)]"'] +Line 117: Unexpected errors ['generics_paramspec_variance.py:117:26 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] +Line 128: Unexpected errors ['generics_paramspec_variance.py:128:46 - error: Type "CovariantParamSpecOld[(int)]" is not assignable to declared type "CovariantParamSpecOld[(object)]"'] """ output = """ generics_paramspec_variance.py:14:42 - error: Type "InvariantParamSpec[(int)]" is not assignable to declared type "InvariantParamSpec[(object)]" @@ -29,18 +34,55 @@ generics_paramspec_variance.py:30:36 - error: Type "CovariantParamSpec[(object)] generics_paramspec_variance.py:31:39 - error: Type "CovariantParamSpec[(int)]" is not assignable to declared type "CovariantParamSpec[(object)]"   "CovariantParamSpec[(int)]" is not assignable to "CovariantParamSpec[(object)]"     Type parameter "OutP@CovariantParamSpec" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) -generics_paramspec_variance.py:33:24 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) -generics_paramspec_variance.py:44:49 - error: Type "ContravariantParamSpecOld[(int)]" is not assignable to declared type "ContravariantParamSpecOld[(object)]" +generics_paramspec_variance.py:58:9 - error: Cannot assign to attribute "t" for class "Box[InitP[(a: int)]]" +  "InitP[(*, a: int)]" is not assignable to "InitP[(a: int)]" +    Type parameter "P@InitP" is invariant, but "(*, a: int)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:60:9 - error: Cannot assign to attribute "t" for class "Box[InitP[(a: int)]]" +  "InitP[(a: int, /)]" is not assignable to "InitP[(a: int)]" +    Type parameter "P@InitP" is invariant, but "(a: int, /)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:62:4 - error: Argument missing for parameter "fn" (reportCallIssue) +generics_paramspec_variance.py:62:4 - error: Call expression not allowed in type expression (reportInvalidTypeForm) +generics_paramspec_variance.py:66:9 - error: Cannot assign to attribute "t" for class "Box[InitP[(a: int)]]" +  "InitP[(a: int, b: str)]" is not assignable to "InitP[(a: int)]" +    Type parameter "P@InitP" is invariant, but "(a: int, b: str)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:79:9 - error: Cannot assign to attribute "t" for class "Box[OutitP[(a: int)]]" +  "OutitP[(*, a: int)]" is not assignable to "OutitP[(a: int)]" +    Type parameter "P@OutitP" is invariant, but "(*, a: int)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:81:9 - error: Cannot assign to attribute "t" for class "Box[OutitP[(a: int)]]" +  "OutitP[(a: int, /)]" is not assignable to "OutitP[(a: int)]" +    Type parameter "P@OutitP" is invariant, but "(a: int, /)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:83:4 - error: Argument missing for parameter "fn" (reportCallIssue) +generics_paramspec_variance.py:83:4 - error: Call expression not allowed in type expression (reportInvalidTypeForm) +generics_paramspec_variance.py:87:9 - error: Cannot assign to attribute "t" for class "Box[OutitP[(a: int)]]" +  "OutitP[(a: int, b: str)]" is not assignable to "OutitP[(a: int)]" +    Type parameter "P@OutitP" is invariant, but "(a: int, b: str)" is not the same as "(a: int)" (reportAttributeAccessIssue) +generics_paramspec_variance.py:91:1 - error: ParamSpec must be assigned to a variable named "InP" (reportGeneralTypeIssues) +generics_paramspec_variance.py:92:24 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:93:28 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:93:44 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:94:1 - error: ParamSpec must be assigned to a variable named "InvP1" (reportGeneralTypeIssues) +generics_paramspec_variance.py:94:28 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:94:44 - error: "infer_variance" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:95:1 - error: ParamSpec must be assigned to a variable named "InvP1" (reportGeneralTypeIssues) +generics_paramspec_variance.py:95:28 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:95:48 - error: "infer_variance" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:103:14 - error: Type "InvariantParamSpecOld[(bool)]" is not assignable to declared type "InvariantParamSpecOld[(int)]" +  "InvariantParamSpecOld[(bool)]" is not assignable to "InvariantParamSpecOld[(int)]" +    Type parameter "InP@InvariantParamSpecOld" is invariant, but "(bool)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:104:14 - error: Type "InvariantParamSpecOld[(object)]" is not assignable to declared type "InvariantParamSpecOld[(int)]" +  "InvariantParamSpecOld[(object)]" is not assignable to "InvariantParamSpecOld[(int)]" +    Type parameter "InP@InvariantParamSpecOld" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) +generics_paramspec_variance.py:114:49 - error: Type "ContravariantParamSpecOld[(int)]" is not assignable to declared type "ContravariantParamSpecOld[(object)]"   "ContravariantParamSpecOld[(int)]" is not assignable to "ContravariantParamSpecOld[(object)]"     Type parameter "InP@ContravariantParamSpecOld" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) -generics_paramspec_variance.py:45:46 - error: Type "ContravariantParamSpecOld[(object)]" is not assignable to declared type "ContravariantParamSpecOld[(int)]" +generics_paramspec_variance.py:115:46 - error: Type "ContravariantParamSpecOld[(object)]" is not assignable to declared type "ContravariantParamSpecOld[(int)]"   "ContravariantParamSpecOld[(object)]" is not assignable to "ContravariantParamSpecOld[(int)]"     Type parameter "InP@ContravariantParamSpecOld" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) -generics_paramspec_variance.py:47:26 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) -generics_paramspec_variance.py:57:43 - error: Type "CovariantParamSpecOld[(object)]" is not assignable to declared type "CovariantParamSpecOld[(int)]" +generics_paramspec_variance.py:117:26 - error: "covariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +generics_paramspec_variance.py:127:43 - error: Type "CovariantParamSpecOld[(object)]" is not assignable to declared type "CovariantParamSpecOld[(int)]"   "CovariantParamSpecOld[(object)]" is not assignable to "CovariantParamSpecOld[(int)]"     Type parameter "OutP@CovariantParamSpecOld" is invariant, but "(object)" is not the same as "(int)" (reportAssignmentType) -generics_paramspec_variance.py:58:46 - error: Type "CovariantParamSpecOld[(int)]" is not assignable to declared type "CovariantParamSpecOld[(object)]" +generics_paramspec_variance.py:128:46 - error: Type "CovariantParamSpecOld[(int)]" is not assignable to declared type "CovariantParamSpecOld[(object)]"   "CovariantParamSpecOld[(int)]" is not assignable to "CovariantParamSpecOld[(object)]"     Type parameter "OutP@CovariantParamSpecOld" is invariant, but "(int)" is not the same as "(object)" (reportAssignmentType) """ diff --git a/conformance/results/pyright/generics_typevartuple_variance.toml b/conformance/results/pyright/generics_typevartuple_variance.toml index 38247f32f..0d7578e7c 100644 --- a/conformance/results/pyright/generics_typevartuple_variance.toml +++ b/conformance/results/pyright/generics_typevartuple_variance.toml @@ -1,18 +1,17 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ -Line 16: Expected 1 errors -Line 60: Expected 1 errors -Line 71: Expected 1 errors -Line 24: Unexpected errors ['generics_typevartuple_variance.py:24:42 - error: Type "ContravariantTypeVarTuple[object]" is not assignable to declared type "ContravariantTypeVarTuple[int]"'] -Line 33: Unexpected errors ['generics_typevartuple_variance.py:33:42 - error: Type "CovariantTypeVarTuple[int]" is not assignable to declared type "CovariantTypeVarTuple[object]"'] -Line 34: Unexpected errors ['generics_typevartuple_variance.py:34:54 - error: Type "CovariantTypeVarTuple[int, int]" is not assignable to declared type "CovariantTypeVarTuple[float, float]"'] -Line 43: Unexpected errors ['generics_typevartuple_variance.py:43:27 - error: Unpack operator not allowed in type expression (reportInvalidTypeForm)', 'generics_typevartuple_variance.py:43:28 - error: "InTs" is not defined (reportUndefinedVariable)'] -Line 46: Unexpected errors ['generics_typevartuple_variance.py:46:31 - error: "InTs" is not defined (reportUndefinedVariable)', 'generics_typevartuple_variance.py:46:31 - error: Unpack is not allowed in this context (reportInvalidTypeForm)'] -Line 54: Unexpected errors ['generics_typevartuple_variance.py:54:29 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues)'] -Line 65: Unexpected errors ['generics_typevartuple_variance.py:65:49 - error: Type "ContravariantTypeVarTupleOld[object]" is not assignable to declared type "ContravariantTypeVarTupleOld[int]"'] -Line 68: Unexpected errors ['generics_typevartuple_variance.py:68:31 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues)'] -Line 79: Unexpected errors ['generics_typevartuple_variance.py:79:49 - error: Type "CovariantTypeVarTupleOld[int]" is not assignable to declared type "CovariantTypeVarTupleOld[object]"'] +Line 72: Expected 1 errors +Line 83: Expected 1 errors +Line 27: Unexpected errors ['generics_typevartuple_variance.py:27:42 - error: Type "ContravariantTypeVarTuple[object]" is not assignable to declared type "ContravariantTypeVarTuple[int]"'] +Line 28: Unexpected errors ['generics_typevartuple_variance.py:28:64 - error: Type "ContravariantTypeVarTuple[*tuple[object, ...]]" is not assignable to declared type "ContravariantTypeVarTuple[*tuple[int, ...]]"'] +Line 39: Unexpected errors ['generics_typevartuple_variance.py:39:42 - error: Type "CovariantTypeVarTuple[int]" is not assignable to declared type "CovariantTypeVarTuple[object]"'] +Line 40: Unexpected errors ['generics_typevartuple_variance.py:40:50 - error: Type "CovariantTypeVarTuple[bool, bool]" is not assignable to declared type "CovariantTypeVarTuple[int, int]"'] +Line 45: Unexpected errors ['generics_typevartuple_variance.py:45:67 - error: Type "CovariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "CovariantTypeVarTuple[*tuple[object, ...]]"'] +Line 66: Unexpected errors ['generics_typevartuple_variance.py:66:29 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues)'] +Line 77: Unexpected errors ['generics_typevartuple_variance.py:77:49 - error: Type "ContravariantTypeVarTupleOld[object]" is not assignable to declared type "ContravariantTypeVarTupleOld[int]"'] +Line 80: Unexpected errors ['generics_typevartuple_variance.py:80:31 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues)'] +Line 91: Unexpected errors ['generics_typevartuple_variance.py:91:49 - error: Type "CovariantTypeVarTupleOld[int]" is not assignable to declared type "CovariantTypeVarTupleOld[object]"'] """ output = """ generics_typevartuple_variance.py:14:45 - error: Type "InvariantTypeVarTuple[int]" is not assignable to declared type "InvariantTypeVarTuple[object]" @@ -21,52 +20,72 @@ generics_typevartuple_variance.py:14:45 - error: Type "InvariantTypeVarTuple[int generics_typevartuple_variance.py:15:42 - error: Type "InvariantTypeVarTuple[object]" is not assignable to declared type "InvariantTypeVarTuple[int]"   "InvariantTypeVarTuple[object]" is not assignable to "InvariantTypeVarTuple[int]"     Type parameter "InOutTs@InvariantTypeVarTuple" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) -generics_typevartuple_variance.py:23:53 - error: Type "ContravariantTypeVarTuple[int]" is not assignable to declared type "ContravariantTypeVarTuple[object, object]" -  "ContravariantTypeVarTuple[int]" is not assignable to "ContravariantTypeVarTuple[object, object]" -    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[int]" is not the same as "*tuple[object, object]" (reportAssignmentType) -generics_typevartuple_variance.py:24:42 - error: Type "ContravariantTypeVarTuple[object]" is not assignable to declared type "ContravariantTypeVarTuple[int]" +generics_typevartuple_variance.py:17:64 - error: Type "InvariantTypeVarTuple[*tuple[object, ...]]" is not assignable to declared type "InvariantTypeVarTuple[*tuple[int, ...]]" +  "InvariantTypeVarTuple[*tuple[object, ...]]" is not assignable to "InvariantTypeVarTuple[*tuple[int, ...]]" +    Type parameter "InOutTs@InvariantTypeVarTuple" is invariant, but "*tuple[object, ...]" is not the same as "*tuple[int, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:18:70 - error: Type "InvariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "InvariantTypeVarTuple[*tuple[object, ...]]" +  "InvariantTypeVarTuple[*tuple[int, ...]]" is not assignable to "InvariantTypeVarTuple[*tuple[object, ...]]" +    Type parameter "InOutTs@InvariantTypeVarTuple" is invariant, but "*tuple[int, ...]" is not the same as "*tuple[object, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:26:53 - error: Type "ContravariantTypeVarTuple[object, int]" is not assignable to declared type "ContravariantTypeVarTuple[object, object]" +  "ContravariantTypeVarTuple[object, int]" is not assignable to "ContravariantTypeVarTuple[object, object]" +    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[object, int]" is not the same as "*tuple[object, object]" (reportAssignmentType) +generics_typevartuple_variance.py:27:42 - error: Type "ContravariantTypeVarTuple[object]" is not assignable to declared type "ContravariantTypeVarTuple[int]"   "ContravariantTypeVarTuple[object]" is not assignable to "ContravariantTypeVarTuple[int]"     Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) -generics_typevartuple_variance.py:32:39 - error: Type "CovariantTypeVarTuple[object]" is not assignable to declared type "CovariantTypeVarTuple[int]" +generics_typevartuple_variance.py:28:64 - error: Type "ContravariantTypeVarTuple[*tuple[object, ...]]" is not assignable to declared type "ContravariantTypeVarTuple[*tuple[int, ...]]" +  "ContravariantTypeVarTuple[*tuple[object, ...]]" is not assignable to "ContravariantTypeVarTuple[*tuple[int, ...]]" +    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[object, ...]" is not the same as "*tuple[int, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:29:70 - error: Type "ContravariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "ContravariantTypeVarTuple[*tuple[object, ...]]" +  "ContravariantTypeVarTuple[*tuple[int, ...]]" is not assignable to "ContravariantTypeVarTuple[*tuple[object, ...]]" +    Type parameter "InTs@ContravariantTypeVarTuple" is invariant, but "*tuple[int, ...]" is not the same as "*tuple[object, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:38:39 - error: Type "CovariantTypeVarTuple[object]" is not assignable to declared type "CovariantTypeVarTuple[int]"   "CovariantTypeVarTuple[object]" is not assignable to "CovariantTypeVarTuple[int]"     Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) -generics_typevartuple_variance.py:33:42 - error: Type "CovariantTypeVarTuple[int]" is not assignable to declared type "CovariantTypeVarTuple[object]" +generics_typevartuple_variance.py:39:42 - error: Type "CovariantTypeVarTuple[int]" is not assignable to declared type "CovariantTypeVarTuple[object]"   "CovariantTypeVarTuple[int]" is not assignable to "CovariantTypeVarTuple[object]"     Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) -generics_typevartuple_variance.py:34:54 - error: Type "CovariantTypeVarTuple[int, int]" is not assignable to declared type "CovariantTypeVarTuple[float, float]" -  "CovariantTypeVarTuple[int, int]" is not assignable to "CovariantTypeVarTuple[float, float]" -    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[int, int]" is not the same as "*tuple[float, float]" (reportAssignmentType) -generics_typevartuple_variance.py:35:54 - error: Type "CovariantTypeVarTuple[int, object]" is not assignable to declared type "CovariantTypeVarTuple[float, float]" -  "CovariantTypeVarTuple[int, object]" is not assignable to "CovariantTypeVarTuple[float, float]" -    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[int, object]" is not the same as "*tuple[float, float]" (reportAssignmentType) -generics_typevartuple_variance.py:36:54 - error: Type "CovariantTypeVarTuple[object, int]" is not assignable to declared type "CovariantTypeVarTuple[float, float]" -  "CovariantTypeVarTuple[object, int]" is not assignable to "CovariantTypeVarTuple[float, float]" -    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object, int]" is not the same as "*tuple[float, float]" (reportAssignmentType) -generics_typevartuple_variance.py:37:54 - error: Type "CovariantTypeVarTuple[object, object]" is not assignable to declared type "CovariantTypeVarTuple[float, float]" -  "CovariantTypeVarTuple[object, object]" is not assignable to "CovariantTypeVarTuple[float, float]" -    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object, object]" is not the same as "*tuple[float, float]" (reportAssignmentType) -generics_typevartuple_variance.py:43:27 - error: Unpack operator not allowed in type expression (reportInvalidTypeForm) -generics_typevartuple_variance.py:43:28 - error: "InTs" is not defined (reportUndefinedVariable) -generics_typevartuple_variance.py:46:31 - error: "InTs" is not defined (reportUndefinedVariable) -generics_typevartuple_variance.py:46:31 - error: Unpack is not allowed in this context (reportInvalidTypeForm) -generics_typevartuple_variance.py:50:45 - error: Type "InvariantTypeVarTupleOld[int]" is not assignable to declared type "InvariantTypeVarTupleOld[object]" +generics_typevartuple_variance.py:40:50 - error: Type "CovariantTypeVarTuple[bool, bool]" is not assignable to declared type "CovariantTypeVarTuple[int, int]" +  "CovariantTypeVarTuple[bool, bool]" is not assignable to "CovariantTypeVarTuple[int, int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[bool, bool]" is not the same as "*tuple[int, int]" (reportAssignmentType) +generics_typevartuple_variance.py:41:50 - error: Type "CovariantTypeVarTuple[bool, object]" is not assignable to declared type "CovariantTypeVarTuple[int, int]" +  "CovariantTypeVarTuple[bool, object]" is not assignable to "CovariantTypeVarTuple[int, int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[bool, object]" is not the same as "*tuple[int, int]" (reportAssignmentType) +generics_typevartuple_variance.py:42:50 - error: Type "CovariantTypeVarTuple[object, bool]" is not assignable to declared type "CovariantTypeVarTuple[int, int]" +  "CovariantTypeVarTuple[object, bool]" is not assignable to "CovariantTypeVarTuple[int, int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object, bool]" is not the same as "*tuple[int, int]" (reportAssignmentType) +generics_typevartuple_variance.py:43:50 - error: Type "CovariantTypeVarTuple[object, object]" is not assignable to declared type "CovariantTypeVarTuple[int, int]" +  "CovariantTypeVarTuple[object, object]" is not assignable to "CovariantTypeVarTuple[int, int]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object, object]" is not the same as "*tuple[int, int]" (reportAssignmentType) +generics_typevartuple_variance.py:44:61 - error: Type "CovariantTypeVarTuple[*tuple[object, ...]]" is not assignable to declared type "CovariantTypeVarTuple[*tuple[int, ...]]" +  "CovariantTypeVarTuple[*tuple[object, ...]]" is not assignable to "CovariantTypeVarTuple[*tuple[int, ...]]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[object, ...]" is not the same as "*tuple[int, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:45:67 - error: Type "CovariantTypeVarTuple[*tuple[int, ...]]" is not assignable to declared type "CovariantTypeVarTuple[*tuple[object, ...]]" +  "CovariantTypeVarTuple[*tuple[int, ...]]" is not assignable to "CovariantTypeVarTuple[*tuple[object, ...]]" +    Type parameter "OutTs@CovariantTypeVarTuple" is invariant, but "*tuple[int, ...]" is not the same as "*tuple[object, ...]" (reportAssignmentType) +generics_typevartuple_variance.py:49:33 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:49:49 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:50:33 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:50:49 - error: "infer_variance" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:51:33 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:51:49 - error: "infer_variance" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:61:45 - error: Type "InvariantTypeVarTupleOld[int]" is not assignable to declared type "InvariantTypeVarTupleOld[object]"   "InvariantTypeVarTupleOld[int]" is not assignable to "InvariantTypeVarTupleOld[object]"     Type parameter "Ts@InvariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) -generics_typevartuple_variance.py:51:42 - error: Type "InvariantTypeVarTupleOld[object]" is not assignable to declared type "InvariantTypeVarTupleOld[int]" +generics_typevartuple_variance.py:62:42 - error: Type "InvariantTypeVarTupleOld[object]" is not assignable to declared type "InvariantTypeVarTupleOld[int]"   "InvariantTypeVarTupleOld[object]" is not assignable to "InvariantTypeVarTupleOld[int]"     Type parameter "Ts@InvariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) -generics_typevartuple_variance.py:54:29 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) -generics_typevartuple_variance.py:64:52 - error: Type "ContravariantTypeVarTupleOld[int]" is not assignable to declared type "ContravariantTypeVarTupleOld[object]" +generics_typevartuple_variance.py:66:29 - error: "contravariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:76:52 - error: Type "ContravariantTypeVarTupleOld[int]" is not assignable to declared type "ContravariantTypeVarTupleOld[object]"   "ContravariantTypeVarTupleOld[int]" is not assignable to "ContravariantTypeVarTupleOld[object]"     Type parameter "InTs@ContravariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) -generics_typevartuple_variance.py:65:49 - error: Type "ContravariantTypeVarTupleOld[object]" is not assignable to declared type "ContravariantTypeVarTupleOld[int]" +generics_typevartuple_variance.py:77:49 - error: Type "ContravariantTypeVarTupleOld[object]" is not assignable to declared type "ContravariantTypeVarTupleOld[int]"   "ContravariantTypeVarTupleOld[object]" is not assignable to "ContravariantTypeVarTupleOld[int]"     Type parameter "InTs@ContravariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) -generics_typevartuple_variance.py:68:31 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) -generics_typevartuple_variance.py:78:46 - error: Type "CovariantTypeVarTupleOld[object]" is not assignable to declared type "CovariantTypeVarTupleOld[int]" +generics_typevartuple_variance.py:80:31 - error: "covariant" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) +generics_typevartuple_variance.py:90:46 - error: Type "CovariantTypeVarTupleOld[object]" is not assignable to declared type "CovariantTypeVarTupleOld[int]"   "CovariantTypeVarTupleOld[object]" is not assignable to "CovariantTypeVarTupleOld[int]"     Type parameter "OutTs@CovariantTypeVarTupleOld" is invariant, but "*tuple[object]" is not the same as "*tuple[int]" (reportAssignmentType) -generics_typevartuple_variance.py:79:49 - error: Type "CovariantTypeVarTupleOld[int]" is not assignable to declared type "CovariantTypeVarTupleOld[object]" +generics_typevartuple_variance.py:91:49 - error: Type "CovariantTypeVarTupleOld[int]" is not assignable to declared type "CovariantTypeVarTupleOld[object]"   "CovariantTypeVarTupleOld[int]" is not assignable to "CovariantTypeVarTupleOld[object]"     Type parameter "OutTs@CovariantTypeVarTupleOld" is invariant, but "*tuple[int]" is not the same as "*tuple[object]" (reportAssignmentType) """ diff --git a/conformance/results/pyright/protocols_variance.toml b/conformance/results/pyright/protocols_variance.toml index 108fd9d99..5ea6133eb 100644 --- a/conformance/results/pyright/protocols_variance.toml +++ b/conformance/results/pyright/protocols_variance.toml @@ -1,15 +1,20 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Doesn't support keyword arguments to ParamSpec +""" output = """ -protocols_variance.py:21:7 - warning: Type variable "T1" used in generic Protocol "AnotherBox" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:40:7 - warning: Type variable "T3" used in generic Protocol "Protocol2" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:56:7 - warning: Type variable "T1" used in generic Protocol "Protocol4" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:61:7 - warning: Type variable "T1_co" used in generic Protocol "Protocol5" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:62:22 - error: Covariant type variable cannot be used in parameter type (reportGeneralTypeIssues) -protocols_variance.py:66:7 - warning: Type variable "T1" used in generic Protocol "Protocol6" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:71:7 - warning: Type variable "T1_contra" used in generic Protocol "Protocol7" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:72:21 - error: Contravariant type variable cannot be used in return type (reportGeneralTypeIssues) -protocols_variance.py:104:7 - warning: Type variable "T1" used in generic Protocol "Protocol12" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:15:20 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues) +protocols_variance.py:22:7 - warning: Type variable "T1" used in generic Protocol "AnotherBox" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:41:7 - warning: Type variable "T3" used in generic Protocol "Protocol2" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:57:7 - warning: Type variable "T1" used in generic Protocol "Protocol4" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:62:7 - warning: Type variable "T1_co" used in generic Protocol "Protocol5" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:63:22 - error: Covariant type variable cannot be used in parameter type (reportGeneralTypeIssues) +protocols_variance.py:67:7 - warning: Type variable "T1" used in generic Protocol "Protocol6" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:72:7 - warning: Type variable "T1_contra" used in generic Protocol "Protocol7" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:73:21 - error: Contravariant type variable cannot be used in return type (reportGeneralTypeIssues) +protocols_variance.py:105:7 - warning: Type variable "T1" used in generic Protocol "Protocol12" should be covariant (reportInvalidTypeVarUse) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 15: Unexpected errors ['protocols_variance.py:15:20 - error: "contravariant" is unknown parameter to ParamSpec (reportGeneralTypeIssues)'] """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 44b7924b0..7e7b6b37d 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -610,6 +610,15 @@

Python Type System Conformance Test Results

Pass Pass + + generics_mixed_variance_inference + Pass + Unsupported + Unsupported + Unsupported + Pass + Unsupported + generics_paramspec_basic Pass @@ -651,6 +660,20 @@

Python Type System Conformance Test Results

Pass Pass + + generics_paramspec_variance + Unsupported + Unsupported + Unsupported + Unsupported + + Partial +
    +
  • Does not error when a ParamSpec is used in a position that violates its explicit variance.
  • +
+ + Unsupported + generics_scoping Pass @@ -827,7 +850,12 @@

Python Type System Conformance Test Results

  • Does not enforce that tuples captured by TypeVarTuple are same length.
  • - Pass + + Partial +
      +
    • doesn't error when there are multiple type var tuples in a definition
    • +
    + Pass Partial @@ -894,6 +922,20 @@

    Python Type System Conformance Test Results

    Pass Pass + + generics_typevartuple_variance + Unsupported + Unsupported + Unsupported + Unsupported + + Partial +
      +
    • Does not error when a ParamSpec is used in a position that violates its explicit variance.
    • +
    + + Unsupported + generics_upper_bound @@ -933,12 +975,12 @@

    Python Type System Conformance Test Results

    - 23 / 30 • 76.7% - 28.5 / 30 • 95.0% - 30 / 30 • 100.0% - 28.5 / 30 • 95.0% - 27 / 30 • 90.0% - 30 / 30 • 100.0% + 24 / 33 • 72.7% + 28 / 33 • 84.8% + 30 / 33 • 90.9% + 28.5 / 33 • 86.4% + 29 / 33 • 87.9% + 30 / 33 • 90.9% @@ -1416,21 +1458,41 @@

    Python Type System Conformance Test Results

    protocols_variance + + Partial +
      +
    • False report of ParamSpec variance keywords.
    • +
    + Pass - Pass - Pass - Pass + + Partial +
      +
    • Doesn't support variance keywords to ParamSpec
    • +
    + + + Partial +
      +
    • Doesn't support keyword arguments to ParamSpec
    • +
    + Unsupported - Pass + + Partial +
      +
    • Doesn't support keyword arguments to ParamSpec.
    • +
    + + 9.5 / 11 • 86.4% 10 / 11 • 90.9% - 10 / 11 • 90.9% - 11 / 11 • 100.0% - 11 / 11 • 100.0% + 10.5 / 11 • 95.5% + 10.5 / 11 • 95.5% 6 / 11 • 54.5% - 11 / 11 • 100.0% + 10.5 / 11 • 95.5% @@ -2602,12 +2664,12 @@

    Python Type System Conformance Test Results

    - 109 / 142 • 76.8% - 131 / 142 • 92.3% - 141 / 142 • 99.3% - 136.5 / 142 • 96.1% - 126 / 142 • 88.7% - 141 / 142 • 99.3% + 109.5 / 145 • 75.5% + 130.5 / 145 • 90.0% + 140.5 / 145 • 96.9% + 136 / 145 • 93.8% + 128 / 145 • 88.3% + 140.5 / 145 • 96.9% diff --git a/conformance/results/ty/generics_mixed_variance_inference.toml b/conformance/results/ty/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..03796e1e0 --- /dev/null +++ b/conformance/results/ty/generics_mixed_variance_inference.toml @@ -0,0 +1,9 @@ +conformant = "Pass" +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_mixed_variance_inference.py:13:22: error[invalid-assignment] Object of type `Mixed[bool, ()]` is not assignable to `Mixed[int, ()]` +generics_mixed_variance_inference.py:16:27: error[invalid-assignment] Object of type `Mixed[int, object, ()]` is not assignable to `Mixed[int, int, ()]` +generics_mixed_variance_inference.py:21:25: error[invalid-assignment] Object of type `Mixed[int, (bool, /)]` is not assignable to `Mixed[int, (int, /)]` +""" diff --git a/conformance/results/ty/generics_paramspec_variance.toml b/conformance/results/ty/generics_paramspec_variance.toml index a36991df6..17232693d 100644 --- a/conformance/results/ty/generics_paramspec_variance.toml +++ b/conformance/results/ty/generics_paramspec_variance.toml @@ -4,14 +4,37 @@ Does not error when a ParamSpec is used in a position that violates its explicit """ conformance_automated = "Fail" errors_diff = """ -Line 40: Expected 1 errors -Line 51: Expected 1 errors +Line 64: Expected 1 errors +Line 79: Expected 1 errors +Line 81: Expected 1 errors +Line 110: Expected 1 errors +Line 121: Expected 1 errors +Line 58: Unexpected errors ['generics_paramspec_variance.py:58:1: error[invalid-assignment] Object of type `InitP[(*, a: int)]` is not assignable to attribute `t` of type `InitP[(a: int)]`'] +Line 60: Unexpected errors ['generics_paramspec_variance.py:60:1: error[invalid-assignment] Object of type `InitP[(a: int, /)]` is not assignable to attribute `t` of type `InitP[(a: int)]`'] +Line 83: Unexpected errors ['generics_paramspec_variance.py:83:4: error[invalid-type-form] Function calls are not allowed in type expressions', 'generics_paramspec_variance.py:83:4: error[missing-argument] No argument provided for required parameter `fn` of `OutitP.__init__`'] +Line 85: Unexpected errors ['generics_paramspec_variance.py:85:1: error[invalid-assignment] Object of type `OutitP[(a: int = 1)]` is not assignable to attribute `t` of type `OutitP[(a: int)]`'] +Line 91: Unexpected errors ['generics_paramspec_variance.py:91:15: error[mismatched-type-name] The name passed to `ParamSpec` must match the variable it is assigned to: Expected "P", got "InP"'] """ output = """ generics_paramspec_variance.py:14:42: error[invalid-assignment] Object of type `InvariantParamSpec[(int, /)]` is not assignable to `InvariantParamSpec[(object, /)]` generics_paramspec_variance.py:15:39: error[invalid-assignment] Object of type `InvariantParamSpec[(object, /)]` is not assignable to `InvariantParamSpec[(int, /)]` generics_paramspec_variance.py:21:42: error[invalid-assignment] Object of type `ContravariantParamSpec[(int, /)]` is not assignable to `ContravariantParamSpec[(object, /)]` generics_paramspec_variance.py:30:36: error[invalid-assignment] Object of type `CovariantParamSpec[(object, /)]` is not assignable to `CovariantParamSpec[(int, /)]` -generics_paramspec_variance.py:44:49: error[invalid-assignment] Object of type `ContravariantParamSpecOld[(int, /)]` is not assignable to `ContravariantParamSpecOld[(object, /)]` -generics_paramspec_variance.py:57:43: error[invalid-assignment] Object of type `CovariantParamSpecOld[(object, /)]` is not assignable to `CovariantParamSpecOld[(int, /)]` +generics_paramspec_variance.py:58:1: error[invalid-assignment] Object of type `InitP[(*, a: int)]` is not assignable to attribute `t` of type `InitP[(a: int)]` +generics_paramspec_variance.py:60:1: error[invalid-assignment] Object of type `InitP[(a: int, /)]` is not assignable to attribute `t` of type `InitP[(a: int)]` +generics_paramspec_variance.py:62:4: error[invalid-type-form] Function calls are not allowed in type expressions +generics_paramspec_variance.py:62:4: error[missing-argument] No argument provided for required parameter `fn` of `InitP.__init__` +generics_paramspec_variance.py:66:1: error[invalid-assignment] Object of type `InitP[(a: int, b: str)]` is not assignable to attribute `t` of type `InitP[(a: int)]` +generics_paramspec_variance.py:83:4: error[invalid-type-form] Function calls are not allowed in type expressions +generics_paramspec_variance.py:83:4: error[missing-argument] No argument provided for required parameter `fn` of `OutitP.__init__` +generics_paramspec_variance.py:85:1: error[invalid-assignment] Object of type `OutitP[(a: int = 1)]` is not assignable to attribute `t` of type `OutitP[(a: int)]` +generics_paramspec_variance.py:87:1: error[invalid-assignment] Object of type `OutitP[(a: int, b: str)]` is not assignable to attribute `t` of type `OutitP[(a: int)]` +generics_paramspec_variance.py:91:15: error[mismatched-type-name] The name passed to `ParamSpec` must match the variable it is assigned to: Expected "P", got "InP" +generics_paramspec_variance.py:93:9: error[invalid-paramspec] A `ParamSpec` cannot be both covariant and contravariant +generics_paramspec_variance.py:94:9: error[invalid-paramspec] A `ParamSpec` cannot specify variance when `infer_variance=True` +generics_paramspec_variance.py:95:9: error[invalid-paramspec] A `ParamSpec` cannot specify variance when `infer_variance=True` +generics_paramspec_variance.py:103:14: error[invalid-assignment] Object of type `InvariantParamSpecOld[(bool, /)]` is not assignable to `InvariantParamSpecOld[(int, /)]` +generics_paramspec_variance.py:104:14: error[invalid-assignment] Object of type `InvariantParamSpecOld[(object, /)]` is not assignable to `InvariantParamSpecOld[(int, /)]` +generics_paramspec_variance.py:114:49: error[invalid-assignment] Object of type `ContravariantParamSpecOld[(int, /)]` is not assignable to `ContravariantParamSpecOld[(object, /)]` +generics_paramspec_variance.py:127:43: error[invalid-assignment] Object of type `CovariantParamSpecOld[(object, /)]` is not assignable to `CovariantParamSpecOld[(int, /)]` """ diff --git a/conformance/results/ty/generics_typevartuple_basic.toml b/conformance/results/ty/generics_typevartuple_basic.toml index 8b639ec3f..ffb88837a 100644 --- a/conformance/results/ty/generics_typevartuple_basic.toml +++ b/conformance/results/ty/generics_typevartuple_basic.toml @@ -1,5 +1,5 @@ conformance_automated = "Pass" -conformant = "Partial" +conformant = "Pass" errors_diff = """ """ output = """ diff --git a/conformance/results/ty/generics_typevartuple_variance.toml b/conformance/results/ty/generics_typevartuple_variance.toml index 600a25fd3..ed7025479 100644 --- a/conformance/results/ty/generics_typevartuple_variance.toml +++ b/conformance/results/ty/generics_typevartuple_variance.toml @@ -1,24 +1,29 @@ -conformant = "Unsupported" +conformant = "Partial" conformance_automated = "Fail" +notes = """ +Does not error when a ParamSpec is used in a position that violates its explicit variance. +""" errors_diff = """ -Line 16: Expected 1 errors -Line 60: Expected 1 errors -Line 71: Expected 1 errors -Line 43: Unexpected errors ['generics_typevartuple_variance.py:43:28: error[unresolved-reference] Name `InTs` used when not defined'] -Line 46: Unexpected errors ['generics_typevartuple_variance.py:46:31: error[unresolved-reference] Name `InTs` used when not defined'] +Line 72: Expected 1 errors +Line 83: Expected 1 errors """ output = """ generics_typevartuple_variance.py:14:45: error[invalid-assignment] Object of type `InvariantTypeVarTuple[int]` is not assignable to `InvariantTypeVarTuple[object]` generics_typevartuple_variance.py:15:42: error[invalid-assignment] Object of type `InvariantTypeVarTuple[object]` is not assignable to `InvariantTypeVarTuple[int]` -generics_typevartuple_variance.py:23:53: error[invalid-assignment] Object of type `ContravariantTypeVarTuple[int]` is not assignable to `ContravariantTypeVarTuple[object, object]` -generics_typevartuple_variance.py:32:39: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` -generics_typevartuple_variance.py:35:54: error[invalid-assignment] Object of type `CovariantTypeVarTuple[int, object]` is not assignable to `CovariantTypeVarTuple[int | float, int | float]` -generics_typevartuple_variance.py:36:54: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object, int]` is not assignable to `CovariantTypeVarTuple[int | float, int | float]` -generics_typevartuple_variance.py:37:54: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object, object]` is not assignable to `CovariantTypeVarTuple[int | float, int | float]` -generics_typevartuple_variance.py:43:28: error[unresolved-reference] Name `InTs` used when not defined -generics_typevartuple_variance.py:46:31: error[unresolved-reference] Name `InTs` used when not defined -generics_typevartuple_variance.py:50:45: error[invalid-assignment] Object of type `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` -generics_typevartuple_variance.py:51:42: error[invalid-assignment] Object of type `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` -generics_typevartuple_variance.py:64:52: error[invalid-assignment] Object of type `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` -generics_typevartuple_variance.py:78:46: error[invalid-assignment] Object of type `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` +generics_typevartuple_variance.py:17:64: error[invalid-assignment] Object of type `InvariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `InvariantTypeVarTuple[*tuple[int, ...]]` +generics_typevartuple_variance.py:18:70: error[invalid-assignment] Object of type `InvariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `InvariantTypeVarTuple[*tuple[object, ...]]` +generics_typevartuple_variance.py:26:53: error[invalid-assignment] Object of type `ContravariantTypeVarTuple[object, int]` is not assignable to `ContravariantTypeVarTuple[object, object]` +generics_typevartuple_variance.py:29:70: error[invalid-assignment] Object of type `ContravariantTypeVarTuple[*tuple[int, ...]]` is not assignable to `ContravariantTypeVarTuple[*tuple[object, ...]]` +generics_typevartuple_variance.py:38:39: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object]` is not assignable to `CovariantTypeVarTuple[int]` +generics_typevartuple_variance.py:41:50: error[invalid-assignment] Object of type `CovariantTypeVarTuple[bool, object]` is not assignable to `CovariantTypeVarTuple[int, int]` +generics_typevartuple_variance.py:42:50: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object, bool]` is not assignable to `CovariantTypeVarTuple[int, int]` +generics_typevartuple_variance.py:43:50: error[invalid-assignment] Object of type `CovariantTypeVarTuple[object, object]` is not assignable to `CovariantTypeVarTuple[int, int]` +generics_typevartuple_variance.py:44:61: error[invalid-assignment] Object of type `CovariantTypeVarTuple[*tuple[object, ...]]` is not assignable to `CovariantTypeVarTuple[*tuple[int, ...]]` +generics_typevartuple_variance.py:49:10: error[invalid-legacy-type-variable] A `TypeVarTuple` cannot be both covariant and contravariant +generics_typevartuple_variance.py:50:10: error[invalid-legacy-type-variable] A `TypeVarTuple` cannot specify variance when `infer_variance=True` +generics_typevartuple_variance.py:51:10: error[invalid-legacy-type-variable] A `TypeVarTuple` cannot specify variance when `infer_variance=True` +generics_typevartuple_variance.py:61:45: error[invalid-assignment] Object of type `InvariantTypeVarTupleOld[int]` is not assignable to `InvariantTypeVarTupleOld[object]` +generics_typevartuple_variance.py:62:42: error[invalid-assignment] Object of type `InvariantTypeVarTupleOld[object]` is not assignable to `InvariantTypeVarTupleOld[int]` +generics_typevartuple_variance.py:76:52: error[invalid-assignment] Object of type `ContravariantTypeVarTupleOld[int]` is not assignable to `ContravariantTypeVarTupleOld[object]` +generics_typevartuple_variance.py:90:46: error[invalid-assignment] Object of type `CovariantTypeVarTupleOld[object]` is not assignable to `CovariantTypeVarTupleOld[int]` """ diff --git a/conformance/results/ty/protocols_variance.toml b/conformance/results/ty/protocols_variance.toml index 303056e98..7e595c1a9 100644 --- a/conformance/results/ty/protocols_variance.toml +++ b/conformance/results/ty/protocols_variance.toml @@ -1,13 +1,13 @@ conformance_automated = "Fail" conformant = "Unsupported" errors_diff = """ -Line 21: Expected 1 errors -Line 40: Expected 1 errors -Line 56: Expected 1 errors -Line 66: Expected 1 errors -Line 104: Expected 1 errors -Lines 61, 62: Expected error (tag 'covariant_in_input') -Lines 71, 72: Expected error (tag 'contravariant_in_output') +Line 22: Expected 1 errors +Line 41: Expected 1 errors +Line 57: Expected 1 errors +Line 67: Expected 1 errors +Line 105: Expected 1 errors +Lines 62, 63: Expected error (tag 'covariant_in_input') +Lines 72, 73: Expected error (tag 'contravariant_in_output') """ output = """ """ diff --git a/conformance/results/ty/typeddicts_readonly_inheritance.toml b/conformance/results/ty/typeddicts_readonly_inheritance.toml index bc9847757..117396986 100644 --- a/conformance/results/ty/typeddicts_readonly_inheritance.toml +++ b/conformance/results/ty/typeddicts_readonly_inheritance.toml @@ -12,3 +12,5 @@ typeddicts_readonly_inheritance.py:106:5: error[invalid-typed-dict-field] Cannot typeddicts_readonly_inheritance.py:119:7: error[invalid-typed-dict-field] Cannot overwrite TypedDict field `x` while merging base classes: Inherited mutable field type `int | float` is incompatible with `int` typeddicts_readonly_inheritance.py:132:7: error[invalid-typed-dict-field] Cannot overwrite TypedDict field `x` while merging base classes: Required inherited fields cannot be redeclared as `NotRequired` """ +errors_diff = """ +""" diff --git a/conformance/results/zuban/generics_mixed_variance_inference.toml b/conformance/results/zuban/generics_mixed_variance_inference.toml new file mode 100644 index 000000000..47432b050 --- /dev/null +++ b/conformance/results/zuban/generics_mixed_variance_inference.toml @@ -0,0 +1,11 @@ +conformant = "Unsupported" +conformance_automated = "Fail" +errors_diff = """ +Line 17: Unexpected errors ['generics_mixed_variance_inference.py:17: error: Incompatible types in assignment (expression has type "Mixed[int, bool, []]", variable has type "Mixed[int, int, []]") [assignment]'] +""" +output = """ +generics_mixed_variance_inference.py:13: error: Incompatible types in assignment (expression has type "Mixed[bool, []]", variable has type "Mixed[int, []]") [assignment] +generics_mixed_variance_inference.py:16: error: Incompatible types in assignment (expression has type "Mixed[int, object, []]", variable has type "Mixed[int, int, []]") [assignment] +generics_mixed_variance_inference.py:17: error: Incompatible types in assignment (expression has type "Mixed[int, bool, []]", variable has type "Mixed[int, int, []]") [assignment] +generics_mixed_variance_inference.py:21: error: Incompatible types in assignment (expression has type "Mixed[int, [bool]]", variable has type "Mixed[int, [int]]") [assignment] +""" diff --git a/conformance/results/zuban/generics_paramspec_variance.toml b/conformance/results/zuban/generics_paramspec_variance.toml index 78fb77e60..3d524f697 100644 --- a/conformance/results/zuban/generics_paramspec_variance.toml +++ b/conformance/results/zuban/generics_paramspec_variance.toml @@ -3,20 +3,44 @@ conformance_automated = "Fail" errors_diff = """ Line 15: Expected 1 errors Line 30: Expected 1 errors -Line 40: Expected 1 errors -Line 51: Expected 1 errors -Line 57: Expected 1 errors +Line 64: Expected 1 errors +Line 104: Expected 1 errors +Line 110: Expected 1 errors +Line 121: Expected 1 errors +Line 127: Expected 1 errors Line 31: Unexpected errors ['generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment]'] -Line 33: Unexpected errors ['generics_paramspec_variance.py:33: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] -Line 47: Unexpected errors ['generics_paramspec_variance.py:47: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] -Line 58: Unexpected errors ['generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]'] +Line 58: Unexpected errors ['generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "InitP[[*, a: int]]", variable has type "InitP[[a: int]]") [assignment]'] +Line 60: Unexpected errors ['generics_paramspec_variance.py:60: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[a: int]]") [assignment]'] +Line 83: Unexpected errors ['generics_paramspec_variance.py:83: error: Invalid type comment or annotation [valid-type]'] +Line 91: Unexpected errors ['generics_paramspec_variance.py:91: error: String argument 1 "InP" to ParamSpec(...) does not match variable name "P" [misc]'] +Line 92: Unexpected errors ['generics_paramspec_variance.py:92: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 117: Unexpected errors ['generics_paramspec_variance.py:117: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] +Line 128: Unexpected errors ['generics_paramspec_variance.py:128: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment]'] """ output = """ generics_paramspec_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantParamSpec[[int]]", variable has type "InvariantParamSpec[[object]]") [assignment] generics_paramspec_variance.py:21: error: Incompatible types in assignment (expression has type "ContravariantParamSpec[[int]]", variable has type "ContravariantParamSpec[[object]]") [assignment] generics_paramspec_variance.py:31: error: Incompatible types in assignment (expression has type "CovariantParamSpec[[int]]", variable has type "CovariantParamSpec[[object]]") [assignment] -generics_paramspec_variance.py:33: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] -generics_paramspec_variance.py:44: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment] -generics_paramspec_variance.py:47: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] -generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:58: error: Incompatible types in assignment (expression has type "InitP[[*, a: int]]", variable has type "InitP[[a: int]]") [assignment] +generics_paramspec_variance.py:60: error: Incompatible types in assignment (expression has type "InitP[[int]]", variable has type "InitP[[a: int]]") [assignment] +generics_paramspec_variance.py:62: error: Invalid type comment or annotation [valid-type] +generics_paramspec_variance.py:66: error: Incompatible types in assignment (expression has type "InitP[[a: int, b: str]]", variable has type "InitP[[a: int]]") [assignment] +generics_paramspec_variance.py:79: error: Incompatible types in assignment (expression has type "OutitP[[*, a: int]]", variable has type "OutitP[[a: int]]") [assignment] +generics_paramspec_variance.py:81: error: Incompatible types in assignment (expression has type "OutitP[[int]]", variable has type "OutitP[[a: int]]") [assignment] +generics_paramspec_variance.py:83: error: Invalid type comment or annotation [valid-type] +generics_paramspec_variance.py:87: error: Incompatible types in assignment (expression has type "OutitP[[a: int, b: str]]", variable has type "OutitP[[a: int]]") [assignment] +generics_paramspec_variance.py:91: error: String argument 1 "InP" to ParamSpec(...) does not match variable name "P" [misc] +generics_paramspec_variance.py:92: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:93: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:93: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:94: error: String argument 1 "InvP1" to ParamSpec(...) does not match variable name "InvP2" [misc] +generics_paramspec_variance.py:94: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:94: error: Unexpected argument to "ParamSpec()" [misc] +generics_paramspec_variance.py:95: error: String argument 1 "InvP1" to ParamSpec(...) does not match variable name "InvP3" [misc] +generics_paramspec_variance.py:95: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:95: error: Unexpected argument to "ParamSpec()" [misc] +generics_paramspec_variance.py:103: error: Incompatible types in assignment (expression has type "InvariantParamSpecOld[[bool]]", variable has type "InvariantParamSpecOld[[int]]") [assignment] +generics_paramspec_variance.py:114: error: Incompatible types in assignment (expression has type "ContravariantParamSpecOld[[int]]", variable has type "ContravariantParamSpecOld[[object]]") [assignment] +generics_paramspec_variance.py:117: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +generics_paramspec_variance.py:128: error: Incompatible types in assignment (expression has type "CovariantParamSpecOld[[int]]", variable has type "CovariantParamSpecOld[[object]]") [assignment] """ diff --git a/conformance/results/zuban/generics_typevartuple_variance.toml b/conformance/results/zuban/generics_typevartuple_variance.toml index 5450e51ee..b3127ff2b 100644 --- a/conformance/results/zuban/generics_typevartuple_variance.toml +++ b/conformance/results/zuban/generics_typevartuple_variance.toml @@ -1,34 +1,47 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ -Line 16: Expected 1 errors -Line 60: Expected 1 errors -Line 71: Expected 1 errors -Line 24: Unexpected errors ['generics_typevartuple_variance.py:24: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] -Line 33: Unexpected errors ['generics_typevartuple_variance.py:33: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[object]") [assignment]'] -Line 34: Unexpected errors ['generics_typevartuple_variance.py:34: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int, int]", variable has type "CovariantTypeVarTuple[float, float]") [assignment]'] -Line 54: Unexpected errors ['generics_typevartuple_variance.py:54: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg]'] -Line 65: Unexpected errors ['generics_typevartuple_variance.py:65: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment]'] -Line 68: Unexpected errors ['generics_typevartuple_variance.py:68: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg]'] -Line 79: Unexpected errors ['generics_typevartuple_variance.py:79: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[int]", variable has type "CovariantTypeVarTupleOld[object]") [assignment]'] +Line 72: Expected 1 errors +Line 83: Expected 1 errors +Line 27: Unexpected errors ['generics_typevartuple_variance.py:27: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment]'] +Line 28: Unexpected errors ['generics_typevartuple_variance.py:28: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment]'] +Line 39: Unexpected errors ['generics_typevartuple_variance.py:39: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[object]") [assignment]'] +Line 40: Unexpected errors ['generics_typevartuple_variance.py:40: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment]'] +Line 45: Unexpected errors ['generics_typevartuple_variance.py:45: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment]'] +Line 66: Unexpected errors ['generics_typevartuple_variance.py:66: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg]'] +Line 77: Unexpected errors ['generics_typevartuple_variance.py:77: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment]'] +Line 80: Unexpected errors ['generics_typevartuple_variance.py:80: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg]'] +Line 91: Unexpected errors ['generics_typevartuple_variance.py:91: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[int]", variable has type "CovariantTypeVarTupleOld[object]") [assignment]'] """ output = """ generics_typevartuple_variance.py:14: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[int]", variable has type "InvariantTypeVarTuple[object]") [assignment] generics_typevartuple_variance.py:15: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[object]", variable has type "InvariantTypeVarTuple[int]") [assignment] -generics_typevartuple_variance.py:23: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[int]", variable has type "ContravariantTypeVarTuple[object, object]") [assignment] -generics_typevartuple_variance.py:24: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment] -generics_typevartuple_variance.py:32: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object]", variable has type "CovariantTypeVarTuple[int]") [assignment] -generics_typevartuple_variance.py:33: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[object]") [assignment] -generics_typevartuple_variance.py:34: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int, int]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] -generics_typevartuple_variance.py:35: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int, object]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] -generics_typevartuple_variance.py:36: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, int]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] -generics_typevartuple_variance.py:37: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, object]", variable has type "CovariantTypeVarTuple[float, float]") [assignment] -generics_typevartuple_variance.py:50: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[int]", variable has type "InvariantTypeVarTupleOld[object]") [assignment] -generics_typevartuple_variance.py:51: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[object]", variable has type "InvariantTypeVarTupleOld[int]") [assignment] -generics_typevartuple_variance.py:54: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg] -generics_typevartuple_variance.py:64: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[int]", variable has type "ContravariantTypeVarTupleOld[object]") [assignment] -generics_typevartuple_variance.py:65: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment] -generics_typevartuple_variance.py:68: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] -generics_typevartuple_variance.py:78: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[object]", variable has type "CovariantTypeVarTupleOld[int]") [assignment] -generics_typevartuple_variance.py:79: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[int]", variable has type "CovariantTypeVarTupleOld[object]") [assignment] +generics_typevartuple_variance.py:17: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "InvariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] +generics_typevartuple_variance.py:18: error: Incompatible types in assignment (expression has type "InvariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "InvariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment] +generics_typevartuple_variance.py:26: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object, int]", variable has type "ContravariantTypeVarTuple[object, object]") [assignment] +generics_typevartuple_variance.py:27: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[object]", variable has type "ContravariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:28: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] +generics_typevartuple_variance.py:29: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "ContravariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment] +generics_typevartuple_variance.py:38: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object]", variable has type "CovariantTypeVarTuple[int]") [assignment] +generics_typevartuple_variance.py:39: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[int]", variable has type "CovariantTypeVarTuple[object]") [assignment] +generics_typevartuple_variance.py:40: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:41: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[bool, object]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:42: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, bool]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:43: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[object, object]", variable has type "CovariantTypeVarTuple[int, int]") [assignment] +generics_typevartuple_variance.py:44: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[object, ...]]]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]") [assignment] +generics_typevartuple_variance.py:45: error: Incompatible types in assignment (expression has type "CovariantTypeVarTuple[Unpack[Tuple[int, ...]]]", variable has type "CovariantTypeVarTuple[Unpack[Tuple[object, ...]]]") [assignment] +generics_typevartuple_variance.py:49: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:49: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:50: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:50: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:51: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:51: error: Unexpected keyword argument "infer_variance" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:61: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[int]", variable has type "InvariantTypeVarTupleOld[object]") [assignment] +generics_typevartuple_variance.py:62: error: Incompatible types in assignment (expression has type "InvariantTypeVarTupleOld[object]", variable has type "InvariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:66: error: Unexpected keyword argument "contravariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:76: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[int]", variable has type "ContravariantTypeVarTupleOld[object]") [assignment] +generics_typevartuple_variance.py:77: error: Incompatible types in assignment (expression has type "ContravariantTypeVarTupleOld[object]", variable has type "ContravariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:80: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [call-arg] +generics_typevartuple_variance.py:90: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[object]", variable has type "CovariantTypeVarTupleOld[int]") [assignment] +generics_typevartuple_variance.py:91: error: Incompatible types in assignment (expression has type "CovariantTypeVarTupleOld[int]", variable has type "CovariantTypeVarTupleOld[object]") [assignment] """ diff --git a/conformance/results/zuban/protocols_variance.toml b/conformance/results/zuban/protocols_variance.toml index ba95f1366..f6d041024 100644 --- a/conformance/results/zuban/protocols_variance.toml +++ b/conformance/results/zuban/protocols_variance.toml @@ -1,14 +1,20 @@ -conformance_automated = "Pass" +conformant = "Partial" +conformance_automated = "Fail" +notes = """ +Doesn't support keyword arguments to ParamSpec. +""" errors_diff = """ +Line 15: Unexpected errors ['protocols_variance.py:15: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc]'] """ output = """ -protocols_variance.py:21: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] -protocols_variance.py:40: error: Invariant type variable "T3" used in protocol where Contravariant one is expected [misc] -protocols_variance.py:56: error: Invariant type variable "T1" used in protocol where Contravariant one is expected [misc] -protocols_variance.py:61: error: Covariant type variable "T1_co" used in protocol where Contravariant one is expected [misc] -protocols_variance.py:62: error: Cannot use a covariant type variable as a parameter [type-var] -protocols_variance.py:66: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] -protocols_variance.py:71: error: Contravariant type variable "T1_contra" used in protocol where Covariant one is expected [misc] -protocols_variance.py:72: error: Cannot use a contravariant type variable as return type [type-var] -protocols_variance.py:104: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] +protocols_variance.py:15: error: The variance and bound arguments to ParamSpec do not have defined semantics yet [misc] +protocols_variance.py:22: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] +protocols_variance.py:41: error: Invariant type variable "T3" used in protocol where Contravariant one is expected [misc] +protocols_variance.py:57: error: Invariant type variable "T1" used in protocol where Contravariant one is expected [misc] +protocols_variance.py:62: error: Covariant type variable "T1_co" used in protocol where Contravariant one is expected [misc] +protocols_variance.py:63: error: Cannot use a covariant type variable as a parameter [type-var] +protocols_variance.py:67: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] +protocols_variance.py:72: error: Contravariant type variable "T1_contra" used in protocol where Covariant one is expected [misc] +protocols_variance.py:73: error: Cannot use a contravariant type variable as return type [type-var] +protocols_variance.py:105: error: Invariant type variable "T1" used in protocol where Covariant one is expected [misc] """ diff --git a/conformance/tests/generics_mixed_variance_inference.py b/conformance/tests/generics_mixed_variance_inference.py new file mode 100644 index 000000000..7bb3a4b3a --- /dev/null +++ b/conformance/tests/generics_mixed_variance_inference.py @@ -0,0 +1,21 @@ +""" +Tests variance inference for mixed type parameters. +""" + +# Specification: https://peps.python.org/pep-0695/#variance-inference + +class Mixed[T, *Ts, **P]: + def f(self, x: T, /, *args: P.args, **kwargs: P.kwargs) -> tuple[*Ts]: + raise NotImplementedError + +# T should be contra +_1: Mixed[int, []] = Mixed[object, []]() # OK +_2: Mixed[int, []] = Mixed[bool, []]() # E + +# Ts should be co +_3: Mixed[int, int, []] = Mixed[int, object, []]() # E +_4: Mixed[int, int, []] = Mixed[int, bool, []]() # OK + +# P should be contra +_5: Mixed[int, [int]] = Mixed[int, [object]]() # OK +_6: Mixed[int, [int]] = Mixed[int, [bool]]() # E diff --git a/conformance/tests/generics_paramspec_variance.py b/conformance/tests/generics_paramspec_variance.py index 67d31a0c9..b3da777bb 100644 --- a/conformance/tests/generics_paramspec_variance.py +++ b/conformance/tests/generics_paramspec_variance.py @@ -30,8 +30,78 @@ def f(self, fn: Callable[OutP, None]) -> None: out_int: CovariantParamSpec[int] = CovariantParamSpec[object]() # E out_obj: CovariantParamSpec[object] = CovariantParamSpec[int]() # OK -InP = ParamSpec("InP", contravariant=True) +# cases involving keyword-only, positional-only parameters, parameter names, defaults and differing callable arities +class Box[T]: + t: T + def __init__(self, t: T): ... + + +def f(a: int): ... +def kw(*, a: int): ... +def pos(a: int, /): ... +def default(a: int = 1): ... +def arity(a: int, b: str): ... + + +class InitP[**P]: # contravariant + def __init__(self, fn: Callable[P, None]): ... + + def usage(self) -> Callable[P, None]: + """infer contravariance""" + raise NotImplementedError + + +box = Box(InitP(f)) + +kw_p = InitP(kw) +box.t = kw_p # OK +pos_p = InitP(pos) +box.t = pos_p # OK +names_p = InitP(f) +_: InitP[int]() = names_p # E +default_p = InitP(default) +box.t = default_p # E +arity_p = InitP(arity) +box.t = arity_p # E + + +class OutitP[**P]: # covariant + def __init__(self, fn: Callable[P, None]): ... + + def usage(self, fn: Callable[P, None]): + """infer covariance""" + + +box = Box(OutitP(f)) + +kw_p = OutitP(kw) +box.t = kw_p # E +pos_p = OutitP(pos) +box.t = pos_p # E +names_p = OutitP(f) +_: OutitP[int]() = names_p # OK +default_p = OutitP(default) +box.t = default_p # OK +arity_p = OutitP(arity) +box.t = arity_p # E + + +# old style +P = ParamSpec("InP") # OK +InP = ParamSpec("InP", contravariant=True) # OK +InvP1 = ParamSpec("InvP1", covariant=True, contravariant=True) # E +InvP2 = ParamSpec("InvP1", covariant=True, infer_variance=True) # E +InvP3 = ParamSpec("InvP1", contravariant=True, infer_variance=True) # E + +class InvariantParamSpecOld(Generic[P]): + def f(self, fn: Callable[InP, None]) -> Callable[InP, None]: # OK + raise NotImplementedError + +in_out_old: InvariantParamSpecOld[int] +in_out_old = InvariantParamSpecOld[int]() # OK +in_out_old = InvariantParamSpecOld[bool]() # E +in_out_old = InvariantParamSpecOld[object]() # E class ContravariantParamSpecOld(Generic[InP]): def in_f(self) -> Callable[InP, None]: # OK diff --git a/conformance/tests/generics_typevartuple_variance.py b/conformance/tests/generics_typevartuple_variance.py index e410118f4..262f37740 100644 --- a/conformance/tests/generics_typevartuple_variance.py +++ b/conformance/tests/generics_typevartuple_variance.py @@ -13,15 +13,21 @@ class InvariantTypeVarTuple[*InOutTs]: in_out_obj: InvariantTypeVarTuple[object] = InvariantTypeVarTuple[int]() # E in_out_int: InvariantTypeVarTuple[int] = InvariantTypeVarTuple[object]() # E -in_out_int = InvariantTypeVarTuple[int]() # E +in_out_int = InvariantTypeVarTuple[int]() +in_out_variadic_int: InvariantTypeVarTuple[*tuple[int, ...]] = InvariantTypeVarTuple[*tuple[object, ...]]() # E +in_out_variadic_object: InvariantTypeVarTuple[*tuple[object, ...]] = InvariantTypeVarTuple[*tuple[int, ...]]() # E +in_out_empty: InvariantTypeVarTuple[()] = InvariantTypeVarTuple[()]() # OK class ContravariantTypeVarTuple[*InTs]: def f(self, t: tuple[*InTs]): raise NotImplementedError -in_obj: ContravariantTypeVarTuple[object, object] = ContravariantTypeVarTuple[int]() # E +in_obj: ContravariantTypeVarTuple[object, object] = ContravariantTypeVarTuple[object, int]() # E in_int: ContravariantTypeVarTuple[int] = ContravariantTypeVarTuple[object]() # OK +in_variadic_int: ContravariantTypeVarTuple[*tuple[int, ...]] = ContravariantTypeVarTuple[*tuple[object, ...]]() # OK +in_variadic_object: ContravariantTypeVarTuple[*tuple[object, ...]] = ContravariantTypeVarTuple[*tuple[int, ...]]() # E +in_empty: ContravariantTypeVarTuple[()] = ContravariantTypeVarTuple[()]() # OK class CovariantTypeVarTuple[*OutTs]: @@ -31,24 +37,30 @@ def f(self) -> tuple[*OutTs]: out_int: CovariantTypeVarTuple[int] = CovariantTypeVarTuple[object]() # E out_obj: CovariantTypeVarTuple[object] = CovariantTypeVarTuple[int]() # OK -out_multiple1: CovariantTypeVarTuple[float, float] = CovariantTypeVarTuple[int, int]() # OK -out_multiple2: CovariantTypeVarTuple[float, float] = CovariantTypeVarTuple[int, object]() # E -out_multiple3: CovariantTypeVarTuple[float, float] = CovariantTypeVarTuple[object, int]() # E -out_multiple4: CovariantTypeVarTuple[float, float] = CovariantTypeVarTuple[object, object]() # E - - -Ts = TypeVarTuple("Ts") +out_multiple1: CovariantTypeVarTuple[int, int] = CovariantTypeVarTuple[bool, bool]() # OK +out_multiple2: CovariantTypeVarTuple[int, int] = CovariantTypeVarTuple[bool, object]() # E +out_multiple3: CovariantTypeVarTuple[int, int] = CovariantTypeVarTuple[object, bool]() # E +out_multiple4: CovariantTypeVarTuple[int, int] = CovariantTypeVarTuple[object, object]() # E +out_variadic_int: CovariantTypeVarTuple[*tuple[int, ...]] = CovariantTypeVarTuple[*tuple[object, ...]]() # E +out_variadic_object: CovariantTypeVarTuple[*tuple[object, ...]] = CovariantTypeVarTuple[*tuple[int, ...]]() # OK +out_empty: CovariantTypeVarTuple[()] = CovariantTypeVarTuple[()]() # OK + +Ts = TypeVarTuple("Ts") # OK +InvTs1 = TypeVarTuple("InvTs1", covariant=True, contravariant=True) # E +InvTs2 = TypeVarTuple("InvTs2", covariant=True, infer_variance=True) # E +InvTs3 = TypeVarTuple("InvTs3", covariant=True, infer_variance=True) # E class InvariantTypeVarTupleOld(Generic[*Ts]): - def in_f(self, *args: *InTs) -> None: # OK + def in_f(self, *args: *Ts) -> None: # OK raise NotImplementedError - def out_f(self) -> tuple[*InTs]: # OK + def out_f(self) -> tuple[*Ts]: # OK raise NotImplementedError obj_old: InvariantTypeVarTupleOld[object] = InvariantTypeVarTupleOld[int]() # E int_old: InvariantTypeVarTupleOld[int] = InvariantTypeVarTupleOld[object]() # E +int_old = InvariantTypeVarTupleOld[int]() InTs = TypeVarTuple("InTs", contravariant=True) diff --git a/conformance/tests/protocols_variance.py b/conformance/tests/protocols_variance.py index 069ab8ecd..724692b60 100644 --- a/conformance/tests/protocols_variance.py +++ b/conformance/tests/protocols_variance.py @@ -4,14 +4,15 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/protocol.html#generic-protocols -from typing import ParamSpec, Protocol, TypeVar +from typing import Protocol, TypeVar +from typing_extensions import ParamSpec T1 = TypeVar("T1") T2 = TypeVar("T2", bound=int) T3 = TypeVar("T3", bytes, str) T1_co = TypeVar("T1_co", covariant=True) T1_contra = TypeVar("T1_contra", contravariant=True) -P = ParamSpec("P") +P = ParamSpec("P", contravariant=True) R = TypeVar("R", covariant=True) # > Type checkers will warn if the inferred variance is different from the diff --git a/conformance/uv.lock b/conformance/uv.lock index 533989b4c..f54adc305 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -1,38 +1,38 @@ version = 1 -revision = 2 +revision = 3 requires-python = "==3.12.*" [[package]] name = "ast-serialize" version = "0.5.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/81/9d/09e27731bd5864a9ce04e3244074e674bb8936bf62b45e0357248717adac/ast_serialize-0.5.0.tar.gz", hash = "sha256:5880091bfe6f4f986f22866375c2e884843e7a0b6343ae41aeea659613d879b6", size = 61157, upload_time = "2026-05-17T17:48:29.429Z" } +sdist = { url = "https://files.pythonhosted.org/packages/81/9d/09e27731bd5864a9ce04e3244074e674bb8936bf62b45e0357248717adac/ast_serialize-0.5.0.tar.gz", hash = "sha256:5880091bfe6f4f986f22866375c2e884843e7a0b6343ae41aeea659613d879b6", size = 61157, upload-time = "2026-05-17T17:48:29.429Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e0/9e/dc2530acb3a60dc6e46d65abf27d1d9f86721694757906a148d90a6860de/ast_serialize-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:0668aa9459cfa8c9c49ddd2163ebcf43088ba045ef7492af6fe22e0098303101", size = 1191380, upload_time = "2026-05-17T17:48:03.738Z" }, - { url = "https://files.pythonhosted.org/packages/26/0a/bd3d18a582f273d6c843d16bb9e22e9e16365ff7991e92f18f798e9f1224/ast_serialize-0.5.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:bf683d6363edf2b39eed6b6d4fe22d34b6203867a67e27134d9e2a2680c4bc4a", size = 1183879, upload_time = "2026-05-17T17:48:05.463Z" }, - { url = "https://files.pythonhosted.org/packages/40/ae/1f919100f8620887af58fcc381c61a1f218cdf89c6e155f87b213e61010a/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc22cf0c9be65e71cf88fda130af60d61eb4a79370ad4cfe7900d48a4aa2211", size = 1244529, upload_time = "2026-05-17T17:48:07.008Z" }, - { url = "https://files.pythonhosted.org/packages/c6/ca/6376559dcce707cdbc1d0d9a13c8d3baaaa501e949ce0ebdc4230cd881aa/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf", size = 1240560, upload_time = "2026-05-17T17:48:08.46Z" }, - { url = "https://files.pythonhosted.org/packages/35/b2/a620e206b5aeb7efbf2710336df57d457cffbb3991076bbcc1147ef9abd4/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9", size = 1451172, upload_time = "2026-05-17T17:48:09.922Z" }, - { url = "https://files.pythonhosted.org/packages/fa/e0/4ad5c04c24a40481b2935ce9a0ccdb6023dc8b667167d06ae530cc3512f2/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b725026bafa801dbd7310eb13a75f0a2e370e7e51b2cb225f9d21fcfadf919ee", size = 1265072, upload_time = "2026-05-17T17:48:11.469Z" }, - { url = "https://files.pythonhosted.org/packages/b2/71/4d1d479aa56d0101c40e17720c3d6ac2af7269ea0487a80b18e7bfd1a5b7/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b54f60c1d78767a53b67eaa663f0dfac3afe606aa07f1301572f588b73d64809", size = 1270488, upload_time = "2026-05-17T17:48:13.575Z" }, - { url = "https://files.pythonhosted.org/packages/6d/4f/0de1bbe06f6edef9fde4ed12ca8e7b3ec7e6e2bd4e672c5af487f7957665/ast_serialize-0.5.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:27d51654fc240a1e87e742d353d98eb45b75f62f129086b3596ab53df2ac2a43", size = 1260702, upload_time = "2026-05-17T17:48:15.141Z" }, - { url = "https://files.pythonhosted.org/packages/75/61/e00872439cfdddcc3c1b6cdaa6e5d904ba8e26a18807c67c4e14409d0ca8/ast_serialize-0.5.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c36237c46dd1674542f2109740ea5ea485a169bf1431939ada0434e17934", size = 1311182, upload_time = "2026-05-17T17:48:16.779Z" }, - { url = "https://files.pythonhosted.org/packages/76/8e/699a5b955f7926956c95e9e1d74132acad73c2fe7a426f94da89123c20aa/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1943db345233cc7194a470f13afa9c59772c0b123dea0c9414c4d4ca54369759", size = 1421410, upload_time = "2026-05-17T17:48:18.527Z" }, - { url = "https://files.pythonhosted.org/packages/a9/ae/d5b7626874478997adc7a29ab28accf21e596fb590c944290401dfd0b29e/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:df1c00022cbbcb064bfaa505aa9c9295362443ce5dacb459d1331d3da353f887", size = 1516587, upload_time = "2026-05-17T17:48:20.133Z" }, - { url = "https://files.pythonhosted.org/packages/0c/ce/b59e02a82d9c4244d64cde502e0b00e83e38816abe19155ceb5437402c7f/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:cae65289fc456fde04af979a2be09302ef5d8ab92ef23e596d6746dc267ada27", size = 1515171, upload_time = "2026-05-17T17:48:21.921Z" }, - { url = "https://files.pythonhosted.org/packages/8b/38/d8d90042747d05aa08d4efcf1c99035a5f670a6bf4c214d31644392afbca/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:239a4c354e8d676e9d94631d1d4a64edc6b266f86ff3a5a80aedd344f342c01d", size = 1464668, upload_time = "2026-05-17T17:48:23.544Z" }, - { url = "https://files.pythonhosted.org/packages/dd/51/5b840c4df7334104cecffa28f23904fe81ca89ca223d2450e288de39fd3c/ast_serialize-0.5.0-cp39-abi3-win32.whl", hash = "sha256:143a4ef63285a075871908fda3672dc21864b83a8ec3ee12304aa3e4c5387b9a", size = 1068311, upload_time = "2026-05-17T17:48:25.027Z" }, - { url = "https://files.pythonhosted.org/packages/41/11/ca5672c7d491825bc4cd6702dea106a6b60d928707712ec257c7833ae476/ast_serialize-0.5.0-cp39-abi3-win_amd64.whl", hash = "sha256:cf25572c526add400f26a4750dc6ce0c3bb93fc1f75e7ae0cad4ce4f2cd5c590", size = 1108931, upload_time = "2026-05-17T17:48:26.591Z" }, - { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload_time = "2026-05-17T17:48:28.122Z" }, + { url = "https://files.pythonhosted.org/packages/e0/9e/dc2530acb3a60dc6e46d65abf27d1d9f86721694757906a148d90a6860de/ast_serialize-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:0668aa9459cfa8c9c49ddd2163ebcf43088ba045ef7492af6fe22e0098303101", size = 1191380, upload-time = "2026-05-17T17:48:03.738Z" }, + { url = "https://files.pythonhosted.org/packages/26/0a/bd3d18a582f273d6c843d16bb9e22e9e16365ff7991e92f18f798e9f1224/ast_serialize-0.5.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:bf683d6363edf2b39eed6b6d4fe22d34b6203867a67e27134d9e2a2680c4bc4a", size = 1183879, upload-time = "2026-05-17T17:48:05.463Z" }, + { url = "https://files.pythonhosted.org/packages/40/ae/1f919100f8620887af58fcc381c61a1f218cdf89c6e155f87b213e61010a/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc22cf0c9be65e71cf88fda130af60d61eb4a79370ad4cfe7900d48a4aa2211", size = 1244529, upload-time = "2026-05-17T17:48:07.008Z" }, + { url = "https://files.pythonhosted.org/packages/c6/ca/6376559dcce707cdbc1d0d9a13c8d3baaaa501e949ce0ebdc4230cd881aa/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf", size = 1240560, upload-time = "2026-05-17T17:48:08.46Z" }, + { url = "https://files.pythonhosted.org/packages/35/b2/a620e206b5aeb7efbf2710336df57d457cffbb3991076bbcc1147ef9abd4/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9", size = 1451172, upload-time = "2026-05-17T17:48:09.922Z" }, + { url = "https://files.pythonhosted.org/packages/fa/e0/4ad5c04c24a40481b2935ce9a0ccdb6023dc8b667167d06ae530cc3512f2/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b725026bafa801dbd7310eb13a75f0a2e370e7e51b2cb225f9d21fcfadf919ee", size = 1265072, upload-time = "2026-05-17T17:48:11.469Z" }, + { url = "https://files.pythonhosted.org/packages/b2/71/4d1d479aa56d0101c40e17720c3d6ac2af7269ea0487a80b18e7bfd1a5b7/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b54f60c1d78767a53b67eaa663f0dfac3afe606aa07f1301572f588b73d64809", size = 1270488, upload-time = "2026-05-17T17:48:13.575Z" }, + { url = "https://files.pythonhosted.org/packages/6d/4f/0de1bbe06f6edef9fde4ed12ca8e7b3ec7e6e2bd4e672c5af487f7957665/ast_serialize-0.5.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:27d51654fc240a1e87e742d353d98eb45b75f62f129086b3596ab53df2ac2a43", size = 1260702, upload-time = "2026-05-17T17:48:15.141Z" }, + { url = "https://files.pythonhosted.org/packages/75/61/e00872439cfdddcc3c1b6cdaa6e5d904ba8e26a18807c67c4e14409d0ca8/ast_serialize-0.5.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c36237c46dd1674542f2109740ea5ea485a169bf1431939ada0434e17934", size = 1311182, upload-time = "2026-05-17T17:48:16.779Z" }, + { url = "https://files.pythonhosted.org/packages/76/8e/699a5b955f7926956c95e9e1d74132acad73c2fe7a426f94da89123c20aa/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1943db345233cc7194a470f13afa9c59772c0b123dea0c9414c4d4ca54369759", size = 1421410, upload-time = "2026-05-17T17:48:18.527Z" }, + { url = "https://files.pythonhosted.org/packages/a9/ae/d5b7626874478997adc7a29ab28accf21e596fb590c944290401dfd0b29e/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:df1c00022cbbcb064bfaa505aa9c9295362443ce5dacb459d1331d3da353f887", size = 1516587, upload-time = "2026-05-17T17:48:20.133Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ce/b59e02a82d9c4244d64cde502e0b00e83e38816abe19155ceb5437402c7f/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:cae65289fc456fde04af979a2be09302ef5d8ab92ef23e596d6746dc267ada27", size = 1515171, upload-time = "2026-05-17T17:48:21.921Z" }, + { url = "https://files.pythonhosted.org/packages/8b/38/d8d90042747d05aa08d4efcf1c99035a5f670a6bf4c214d31644392afbca/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:239a4c354e8d676e9d94631d1d4a64edc6b266f86ff3a5a80aedd344f342c01d", size = 1464668, upload-time = "2026-05-17T17:48:23.544Z" }, + { url = "https://files.pythonhosted.org/packages/dd/51/5b840c4df7334104cecffa28f23904fe81ca89ca223d2450e288de39fd3c/ast_serialize-0.5.0-cp39-abi3-win32.whl", hash = "sha256:143a4ef63285a075871908fda3672dc21864b83a8ec3ee12304aa3e4c5387b9a", size = 1068311, upload-time = "2026-05-17T17:48:25.027Z" }, + { url = "https://files.pythonhosted.org/packages/41/11/ca5672c7d491825bc4cd6702dea106a6b60d928707712ec257c7833ae476/ast_serialize-0.5.0-cp39-abi3-win_amd64.whl", hash = "sha256:cf25572c526add400f26a4750dc6ce0c3bb93fc1f75e7ae0cad4ce4f2cd5c590", size = 1108931, upload-time = "2026-05-17T17:48:26.591Z" }, + { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload-time = "2026-05-17T17:48:28.122Z" }, ] [[package]] name = "importlib-resources" version = "7.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e4/06/b56dfa750b44e86157093bc8fca0ab81dccbf5260510de4eaf1cb69b5b99/importlib_resources-7.1.0.tar.gz", hash = "sha256:0722d4c6212489c530f2a145a34c0a7a3b4721bc96a15fada5930e2a0b760708", size = 44985, upload_time = "2026-04-12T16:36:09.232Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e4/06/b56dfa750b44e86157093bc8fca0ab81dccbf5260510de4eaf1cb69b5b99/importlib_resources-7.1.0.tar.gz", hash = "sha256:0722d4c6212489c530f2a145a34c0a7a3b4721bc96a15fada5930e2a0b760708", size = 44985, upload-time = "2026-04-12T16:36:09.232Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8a/db/55a262f3606bebcae07cc14095338471ad7c0bbcaa37707e6f0ee49725b7/importlib_resources-7.1.0-py3-none-any.whl", hash = "sha256:1bd7b48b4088eddb2cd16382150bb515af0bd2c70128194392725f82ad2c96a1", size = 37232, upload_time = "2026-04-12T16:36:08.219Z" }, + { url = "https://files.pythonhosted.org/packages/8a/db/55a262f3606bebcae07cc14095338471ad7c0bbcaa37707e6f0ee49725b7/importlib_resources-7.1.0-py3-none-any.whl", hash = "sha256:1bd7b48b4088eddb2cd16382150bb515af0bd2c70128194392725f82ad2c96a1", size = 37232, upload-time = "2026-04-12T16:36:08.219Z" }, ] [[package]] @@ -42,58 +42,58 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "markupsafe" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload_time = "2025-03-05T20:05:02.478Z" } +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload_time = "2025-03-05T20:05:00.369Z" }, + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, ] [[package]] name = "librt" version = "0.11.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/40/08/9e7f6b5d2b5bed6ad055cdd5925f192bb403a51280f86b56554d9d0699a2/librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1", size = 200139, upload_time = "2026-05-10T18:17:25.138Z" } +sdist = { url = "https://files.pythonhosted.org/packages/40/08/9e7f6b5d2b5bed6ad055cdd5925f192bb403a51280f86b56554d9d0699a2/librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1", size = 200139, upload-time = "2026-05-10T18:17:25.138Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8b/d0/07c77e067f0838949b43bd89232c29d72efebb9d2801a9750184eb706b71/librt-0.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b87504f1690a23b9a2cca841191a04f83895d4fc2dd04df91d82b1a04ca2ad46", size = 144147, upload_time = "2026-05-10T18:15:53.227Z" }, - { url = "https://files.pythonhosted.org/packages/7a/24/8493538fa4f62f982686398a5b8f68008138a75086abdea19ade64bf4255/librt-0.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40071fc5fe0ce8daa6de616702314a01e1250711682b0523d6ab8d4525910cb3", size = 143614, upload_time = "2026-05-10T18:15:54.657Z" }, - { url = "https://files.pythonhosted.org/packages/ff/1e/f8bad050810d9171f34a1648ed910e56814c2ba61639f2bd53c6377ae24b/librt-0.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:137e79445c896a0ea7b265f52d23954e05b64222ee1af69e2cb34219067cbb67", size = 485538, upload_time = "2026-05-10T18:15:56.117Z" }, - { url = "https://files.pythonhosted.org/packages/c0/fe/3594ebfbaf03084ba4b120c9ba5c3183fd938a48725e9bbe6ff0a5159ad8/librt-0.11.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:cca6644054e78746d8d4ef238681f9c34ff8b584fe6b988ecebb8db3b15e622a", size = 479623, upload_time = "2026-05-10T18:15:57.544Z" }, - { url = "https://files.pythonhosted.org/packages/b0/da/5d1876984b3746c85dbd219dbfcb73c85f54ee263fd32e5b2a632ec14571/librt-0.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d5b0eea49f5562861ee8d757a32ef7d559c1d35be2aaaa1ec28941d74c9ffc8a", size = 513082, upload_time = "2026-05-10T18:15:58.805Z" }, - { url = "https://files.pythonhosted.org/packages/19/6e/55bdf5d5ca00c3e18430690bf2c953d8d3ffd3c337418173d33dec985dc9/librt-0.11.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0d1029d7e1ae1a7e647ed6fb5df8c4ce2dffefb7a9f5fd1376a4554d96dac09f", size = 508105, upload_time = "2026-05-10T18:16:00.2Z" }, - { url = "https://files.pythonhosted.org/packages/07/10/f1f23a7c595ee90ece4d35c851e5d104b1311a887ed1b4ac4c35bbd13da8/librt-0.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:bc3ce6b33c5828d9e80592011a5c584cb2ce86edbc4088405f70da47dc1d1b3b", size = 522268, upload_time = "2026-05-10T18:16:01.708Z" }, - { url = "https://files.pythonhosted.org/packages/b6/02/5720f5697a7f54b78b3aefbe20df3a48cedcff1276618c4aa481177942ed/librt-0.11.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:936c5995f3514a42111f20099397d8177c79b4d7e70961e396c6f5a0a3566766", size = 527348, upload_time = "2026-05-10T18:16:03.496Z" }, - { url = "https://files.pythonhosted.org/packages/50/db/b4a47c6f91db4ff76348a0b3dd0cc65e090a078b765a810a62ff9434c3d3/librt-0.11.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:9bc0ca6ad9381cbe8e4aa6e5726e4c80c78115a6e9723c599ed1d73e092bc49d", size = 516294, upload_time = "2026-05-10T18:16:05.173Z" }, - { url = "https://files.pythonhosted.org/packages/9e/58/9384b2f4eb1ed1d273d40948a7c5c4b2360213b402ef3be4641c06299f9c/librt-0.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:070aa8c26c0a74774317a72df8851facc7f0f012a5b406557ac56992d92e1ec8", size = 553608, upload_time = "2026-05-10T18:16:06.839Z" }, - { url = "https://files.pythonhosted.org/packages/21/7b/5aa8848a7c6a9278c79375146da1812e695754ceec5f005e6043461a7315/librt-0.11.0-cp312-cp312-win32.whl", hash = "sha256:6bf14feb84b05ae945277395451998c89c54d0def4070eb5c08de544930b245a", size = 101879, upload_time = "2026-05-10T18:16:08.103Z" }, - { url = "https://files.pythonhosted.org/packages/37/33/8a745436944947575b584231750a41417de1a38cf6a2e9251d1065651c09/librt-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:75672f0bc524ede266287d532d7923dbce94c7514ad07627bac3d0c6d92cc4d9", size = 119831, upload_time = "2026-05-10T18:16:09.174Z" }, - { url = "https://files.pythonhosted.org/packages/59/67/a6739ac96e28b7855808bdb0370e250606104a859750d209e5a0716fe7ab/librt-0.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:2f10cf143e4a9bb0f4f5af568a00df94a2d69ef41c2579584454bb0fe5cc642c", size = 103470, upload_time = "2026-05-10T18:16:10.369Z" }, + { url = "https://files.pythonhosted.org/packages/8b/d0/07c77e067f0838949b43bd89232c29d72efebb9d2801a9750184eb706b71/librt-0.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b87504f1690a23b9a2cca841191a04f83895d4fc2dd04df91d82b1a04ca2ad46", size = 144147, upload-time = "2026-05-10T18:15:53.227Z" }, + { url = "https://files.pythonhosted.org/packages/7a/24/8493538fa4f62f982686398a5b8f68008138a75086abdea19ade64bf4255/librt-0.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40071fc5fe0ce8daa6de616702314a01e1250711682b0523d6ab8d4525910cb3", size = 143614, upload-time = "2026-05-10T18:15:54.657Z" }, + { url = "https://files.pythonhosted.org/packages/ff/1e/f8bad050810d9171f34a1648ed910e56814c2ba61639f2bd53c6377ae24b/librt-0.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:137e79445c896a0ea7b265f52d23954e05b64222ee1af69e2cb34219067cbb67", size = 485538, upload-time = "2026-05-10T18:15:56.117Z" }, + { url = "https://files.pythonhosted.org/packages/c0/fe/3594ebfbaf03084ba4b120c9ba5c3183fd938a48725e9bbe6ff0a5159ad8/librt-0.11.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:cca6644054e78746d8d4ef238681f9c34ff8b584fe6b988ecebb8db3b15e622a", size = 479623, upload-time = "2026-05-10T18:15:57.544Z" }, + { url = "https://files.pythonhosted.org/packages/b0/da/5d1876984b3746c85dbd219dbfcb73c85f54ee263fd32e5b2a632ec14571/librt-0.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d5b0eea49f5562861ee8d757a32ef7d559c1d35be2aaaa1ec28941d74c9ffc8a", size = 513082, upload-time = "2026-05-10T18:15:58.805Z" }, + { url = "https://files.pythonhosted.org/packages/19/6e/55bdf5d5ca00c3e18430690bf2c953d8d3ffd3c337418173d33dec985dc9/librt-0.11.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0d1029d7e1ae1a7e647ed6fb5df8c4ce2dffefb7a9f5fd1376a4554d96dac09f", size = 508105, upload-time = "2026-05-10T18:16:00.2Z" }, + { url = "https://files.pythonhosted.org/packages/07/10/f1f23a7c595ee90ece4d35c851e5d104b1311a887ed1b4ac4c35bbd13da8/librt-0.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:bc3ce6b33c5828d9e80592011a5c584cb2ce86edbc4088405f70da47dc1d1b3b", size = 522268, upload-time = "2026-05-10T18:16:01.708Z" }, + { url = "https://files.pythonhosted.org/packages/b6/02/5720f5697a7f54b78b3aefbe20df3a48cedcff1276618c4aa481177942ed/librt-0.11.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:936c5995f3514a42111f20099397d8177c79b4d7e70961e396c6f5a0a3566766", size = 527348, upload-time = "2026-05-10T18:16:03.496Z" }, + { url = "https://files.pythonhosted.org/packages/50/db/b4a47c6f91db4ff76348a0b3dd0cc65e090a078b765a810a62ff9434c3d3/librt-0.11.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:9bc0ca6ad9381cbe8e4aa6e5726e4c80c78115a6e9723c599ed1d73e092bc49d", size = 516294, upload-time = "2026-05-10T18:16:05.173Z" }, + { url = "https://files.pythonhosted.org/packages/9e/58/9384b2f4eb1ed1d273d40948a7c5c4b2360213b402ef3be4641c06299f9c/librt-0.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:070aa8c26c0a74774317a72df8851facc7f0f012a5b406557ac56992d92e1ec8", size = 553608, upload-time = "2026-05-10T18:16:06.839Z" }, + { url = "https://files.pythonhosted.org/packages/21/7b/5aa8848a7c6a9278c79375146da1812e695754ceec5f005e6043461a7315/librt-0.11.0-cp312-cp312-win32.whl", hash = "sha256:6bf14feb84b05ae945277395451998c89c54d0def4070eb5c08de544930b245a", size = 101879, upload-time = "2026-05-10T18:16:08.103Z" }, + { url = "https://files.pythonhosted.org/packages/37/33/8a745436944947575b584231750a41417de1a38cf6a2e9251d1065651c09/librt-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:75672f0bc524ede266287d532d7923dbce94c7514ad07627bac3d0c6d92cc4d9", size = 119831, upload-time = "2026-05-10T18:16:09.174Z" }, + { url = "https://files.pythonhosted.org/packages/59/67/a6739ac96e28b7855808bdb0370e250606104a859750d209e5a0716fe7ab/librt-0.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:2f10cf143e4a9bb0f4f5af568a00df94a2d69ef41c2579584454bb0fe5cc642c", size = 103470, upload-time = "2026-05-10T18:16:10.369Z" }, ] [[package]] name = "markdown" version = "3.10.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/2b/f4/69fa6ed85ae003c2378ffa8f6d2e3234662abd02c10d216c0ba96081a238/markdown-3.10.2.tar.gz", hash = "sha256:994d51325d25ad8aa7ce4ebaec003febcce822c3f8c911e3b17c52f7f589f950", size = 368805, upload_time = "2026-02-09T14:57:26.942Z" } +sdist = { url = "https://files.pythonhosted.org/packages/2b/f4/69fa6ed85ae003c2378ffa8f6d2e3234662abd02c10d216c0ba96081a238/markdown-3.10.2.tar.gz", hash = "sha256:994d51325d25ad8aa7ce4ebaec003febcce822c3f8c911e3b17c52f7f589f950", size = 368805, upload-time = "2026-02-09T14:57:26.942Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/de/1f/77fa3081e4f66ca3576c896ae5d31c3002ac6607f9747d2e3aa49227e464/markdown-3.10.2-py3-none-any.whl", hash = "sha256:e91464b71ae3ee7afd3017d9f358ef0baf158fd9a298db92f1d4761133824c36", size = 108180, upload_time = "2026-02-09T14:57:25.787Z" }, + { url = "https://files.pythonhosted.org/packages/de/1f/77fa3081e4f66ca3576c896ae5d31c3002ac6607f9747d2e3aa49227e464/markdown-3.10.2-py3-none-any.whl", hash = "sha256:e91464b71ae3ee7afd3017d9f358ef0baf158fd9a298db92f1d4761133824c36", size = 108180, upload-time = "2026-02-09T14:57:25.787Z" }, ] [[package]] name = "markupsafe" version = "3.0.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload_time = "2025-09-27T18:37:40.426Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload_time = "2025-09-27T18:36:30.854Z" }, - { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload_time = "2025-09-27T18:36:31.971Z" }, - { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload_time = "2025-09-27T18:36:32.813Z" }, - { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload_time = "2025-09-27T18:36:33.86Z" }, - { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload_time = "2025-09-27T18:36:35.099Z" }, - { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload_time = "2025-09-27T18:36:36.001Z" }, - { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload_time = "2025-09-27T18:36:36.906Z" }, - { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload_time = "2025-09-27T18:36:37.868Z" }, - { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload_time = "2025-09-27T18:36:38.761Z" }, - { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload_time = "2025-09-27T18:36:39.701Z" }, - { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload_time = "2025-09-27T18:36:40.689Z" }, + { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, + { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, + { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" }, + { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" }, + { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" }, + { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" }, + { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" }, + { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" }, ] [[package]] @@ -107,43 +107,43 @@ dependencies = [ { name = "pathspec" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/82/15/cca9d88503549ed6fedeaa1d448cdddd542ee8a490232d732e278036fbf2/mypy-2.1.0.tar.gz", hash = "sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633", size = 3898359, upload_time = "2026-05-11T18:37:36.237Z" } +sdist = { url = "https://files.pythonhosted.org/packages/82/15/cca9d88503549ed6fedeaa1d448cdddd542ee8a490232d732e278036fbf2/mypy-2.1.0.tar.gz", hash = "sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633", size = 3898359, upload-time = "2026-05-11T18:37:36.237Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/b1/55861beb5c339b44f9a2ba92df9e2cb1eeb4ae1eee674cdf7772c797778b/mypy-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:244358bf1c0da7722230bce60683d52e8e9fd030554926f15b747a84efb5b3af", size = 14874381, upload_time = "2026-05-11T18:37:31.784Z" }, - { url = "https://files.pythonhosted.org/packages/0b/b3/b7f770114b7d0ac92d0f76e8d93c2780844a70488a90e91821927850da86/mypy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4ec7c57657493c7a75534df2751c8ae2cda383c16ecc55d2106c54476b1b16f6", size = 13665501, upload_time = "2026-05-11T18:34:23.063Z" }, - { url = "https://files.pythonhosted.org/packages/b6/f3/8ae2037967e2126689a0c11d99e2b707134a565191e92c60ca2572aec60a/mypy-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d8161b6ff4392410023224f0969d17db93e1e154bc3e4ba62598e720723ae211", size = 14045750, upload_time = "2026-05-11T18:31:48.151Z" }, - { url = "https://files.pythonhosted.org/packages/a0/32/615eb5911859e43d054941b0d0a7d06cfa2870eba86529cf385b052b111c/mypy-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bf03e12003084a67395184d3eb8cbd6a489dc3655b5664b28c210a9e2403ab0b", size = 15061630, upload_time = "2026-05-11T18:37:06.898Z" }, - { url = "https://files.pythonhosted.org/packages/d4/03/4eafbfff8bfab1b87082741eae6e6a624028c984e6708b73bce2a8570c9d/mypy-2.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:20509760fd791c51579d573153407d226385ec1f8bcce55d730b354f3336bc22", size = 15288831, upload_time = "2026-05-11T18:31:18.07Z" }, - { url = "https://files.pythonhosted.org/packages/99/ee/919661478e5891a3c96e549c036e467e64563ab85995b10c53c8358e16a3/mypy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:6753d0c1fdd6b1a23b9e4f283ce80b2153b724adcb2653b20b85a8a28ac6436b", size = 11135228, upload_time = "2026-05-11T18:34:31.23Z" }, - { url = "https://files.pythonhosted.org/packages/24/0a/6a12b9782ca0831a553192f351679f4548abc9d19a7cc93bb7feb02084c7/mypy-2.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:98ebb6589bb3b6d0c6f0c459d53ca55b8091fbc13d277c4041c885392e8195e8", size = 10040684, upload_time = "2026-05-11T18:36:48.199Z" }, - { url = "https://files.pythonhosted.org/packages/0d/2a/13ca1f292f6db1b98ff495ef3467736b331621c5917cad984b7043e7348d/mypy-2.1.0-py3-none-any.whl", hash = "sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289", size = 2693302, upload_time = "2026-05-11T18:31:29.246Z" }, + { url = "https://files.pythonhosted.org/packages/95/b1/55861beb5c339b44f9a2ba92df9e2cb1eeb4ae1eee674cdf7772c797778b/mypy-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:244358bf1c0da7722230bce60683d52e8e9fd030554926f15b747a84efb5b3af", size = 14874381, upload-time = "2026-05-11T18:37:31.784Z" }, + { url = "https://files.pythonhosted.org/packages/0b/b3/b7f770114b7d0ac92d0f76e8d93c2780844a70488a90e91821927850da86/mypy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4ec7c57657493c7a75534df2751c8ae2cda383c16ecc55d2106c54476b1b16f6", size = 13665501, upload-time = "2026-05-11T18:34:23.063Z" }, + { url = "https://files.pythonhosted.org/packages/b6/f3/8ae2037967e2126689a0c11d99e2b707134a565191e92c60ca2572aec60a/mypy-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d8161b6ff4392410023224f0969d17db93e1e154bc3e4ba62598e720723ae211", size = 14045750, upload-time = "2026-05-11T18:31:48.151Z" }, + { url = "https://files.pythonhosted.org/packages/a0/32/615eb5911859e43d054941b0d0a7d06cfa2870eba86529cf385b052b111c/mypy-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bf03e12003084a67395184d3eb8cbd6a489dc3655b5664b28c210a9e2403ab0b", size = 15061630, upload-time = "2026-05-11T18:37:06.898Z" }, + { url = "https://files.pythonhosted.org/packages/d4/03/4eafbfff8bfab1b87082741eae6e6a624028c984e6708b73bce2a8570c9d/mypy-2.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:20509760fd791c51579d573153407d226385ec1f8bcce55d730b354f3336bc22", size = 15288831, upload-time = "2026-05-11T18:31:18.07Z" }, + { url = "https://files.pythonhosted.org/packages/99/ee/919661478e5891a3c96e549c036e467e64563ab85995b10c53c8358e16a3/mypy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:6753d0c1fdd6b1a23b9e4f283ce80b2153b724adcb2653b20b85a8a28ac6436b", size = 11135228, upload-time = "2026-05-11T18:34:31.23Z" }, + { url = "https://files.pythonhosted.org/packages/24/0a/6a12b9782ca0831a553192f351679f4548abc9d19a7cc93bb7feb02084c7/mypy-2.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:98ebb6589bb3b6d0c6f0c459d53ca55b8091fbc13d277c4041c885392e8195e8", size = 10040684, upload-time = "2026-05-11T18:36:48.199Z" }, + { url = "https://files.pythonhosted.org/packages/0d/2a/13ca1f292f6db1b98ff495ef3467736b331621c5917cad984b7043e7348d/mypy-2.1.0-py3-none-any.whl", hash = "sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289", size = 2693302, upload-time = "2026-05-11T18:31:29.246Z" }, ] [[package]] name = "mypy-extensions" version = "1.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload_time = "2025-04-22T14:54:24.164Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload_time = "2025-04-22T14:54:22.983Z" }, + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, ] [[package]] name = "nodeenv" version = "1.10.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload_time = "2025-12-20T14:08:54.006Z" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload_time = "2025-12-20T14:08:52.782Z" }, + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, ] [[package]] name = "pathspec" version = "1.0.4" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/fa/36/e27608899f9b8d4dff0617b2d9ab17ca5608956ca44461ac14ac48b44015/pathspec-1.0.4.tar.gz", hash = "sha256:0210e2ae8a21a9137c0d470578cb0e595af87edaa6ebf12ff176f14a02e0e645", size = 131200, upload_time = "2026-01-27T03:59:46.938Z" } +sdist = { url = "https://files.pythonhosted.org/packages/fa/36/e27608899f9b8d4dff0617b2d9ab17ca5608956ca44461ac14ac48b44015/pathspec-1.0.4.tar.gz", hash = "sha256:0210e2ae8a21a9137c0d470578cb0e595af87edaa6ebf12ff176f14a02e0e645", size = 131200, upload-time = "2026-01-27T03:59:46.938Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ef/3c/2c197d226f9ea224a9ab8d197933f9da0ae0aac5b6e0f884e2b8d9c8e9f7/pathspec-1.0.4-py3-none-any.whl", hash = "sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723", size = 55206, upload_time = "2026-01-27T03:59:45.137Z" }, + { url = "https://files.pythonhosted.org/packages/ef/3c/2c197d226f9ea224a9ab8d197933f9da0ae0aac5b6e0f884e2b8d9c8e9f7/pathspec-1.0.4-py3-none-any.whl", hash = "sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723", size = 55206, upload-time = "2026-01-27T03:59:45.137Z" }, ] [[package]] @@ -154,28 +154,28 @@ dependencies = [ { name = "typeshed-client" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/7c/8e/284fdc4027bf9a7c92f8256ff07006a50456ccd2ce5506d040e6ed2f2f1b/pycroscope-0.4.0.tar.gz", hash = "sha256:14b40e36f6186dd2eff712c8da91d02eb89a263a257472b49f4c59153ff380fb", size = 662901, upload_time = "2026-05-02T14:00:43.775Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7c/8e/284fdc4027bf9a7c92f8256ff07006a50456ccd2ce5506d040e6ed2f2f1b/pycroscope-0.4.0.tar.gz", hash = "sha256:14b40e36f6186dd2eff712c8da91d02eb89a263a257472b49f4c59153ff380fb", size = 662901, upload-time = "2026-05-02T14:00:43.775Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/50/5f/c172c08b69e29d4094e1466b63260d8daf61a3ed3c689de7936f952f1663/pycroscope-0.4.0-py3-none-any.whl", hash = "sha256:cb7440b44ed16ed927995c33867cab22503f4bff7efe504964b81fb967183223", size = 714256, upload_time = "2026-05-02T14:00:41.891Z" }, + { url = "https://files.pythonhosted.org/packages/50/5f/c172c08b69e29d4094e1466b63260d8daf61a3ed3c689de7936f952f1663/pycroscope-0.4.0-py3-none-any.whl", hash = "sha256:cb7440b44ed16ed927995c33867cab22503f4bff7efe504964b81fb967183223", size = 714256, upload-time = "2026-05-02T14:00:41.891Z" }, ] [[package]] name = "pyrefly" version = "1.3.0.dev1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a5/de/fe8d8567d1d092f5d67bb8bbe0863a44919482a37febc79db8aa88088532/pyrefly-1.3.0.dev1.tar.gz", hash = "sha256:189e0e1d3212ab4ecff1d058f9e095fa9711e5e4c19436f7370ceef05d1788fd", size = 6306791, upload_time = "2026-08-07T01:56:51.009Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a5/de/fe8d8567d1d092f5d67bb8bbe0863a44919482a37febc79db8aa88088532/pyrefly-1.3.0.dev1.tar.gz", hash = "sha256:189e0e1d3212ab4ecff1d058f9e095fa9711e5e4c19436f7370ceef05d1788fd", size = 6306791, upload-time = "2026-08-07T01:56:51.009Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ba/6a/ca1ea8084f000ecbf7d6a2a8cde3f2d6f437d0d527f5f0bda0a383fb011f/pyrefly-1.3.0.dev1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:327e245a54357794954a7788d22dd446b90dcc403d0d82414b0b20b6fa37648c", size = 14210092, upload_time = "2026-08-07T01:56:17.895Z" }, - { url = "https://files.pythonhosted.org/packages/a2/df/0f405798d99900a6809483db0262c820ccccdf13b379789d9280d848b9a0/pyrefly-1.3.0.dev1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:00e5d88265c5e3088ac566dd4cf542a13f93e76f7672b738c1306d5d5cae6123", size = 13639017, upload_time = "2026-08-07T01:56:21.181Z" }, - { url = "https://files.pythonhosted.org/packages/4b/28/a41e1daab805124cdefc46566251555bbe0caf24668a851393971eb5cbd7/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c2dcce81731dcc0dcd199b6b0117ebd3df2ee1fc4910f508cb84aa7615182f28", size = 14084976, upload_time = "2026-08-07T01:56:24.551Z" }, - { url = "https://files.pythonhosted.org/packages/df/9c/985e6ab05ab7927d5f6eb8420958957b707f8fbdcb012001b967286a46cc/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56a855f5784978e990effe760e0eaab60b98a0add9bebb79af901d9a8269696d", size = 15230694, upload_time = "2026-08-07T01:56:27.722Z" }, - { url = "https://files.pythonhosted.org/packages/55/73/1368adde6c6f29bd88d5929211291a17c4cf9bddaafd0a3ab330d463ed10/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a0e36aede58dffab44a67ac0f322e416d0fa4955c80d491fc7e0fe80c1a73a5d", size = 15170348, upload_time = "2026-08-07T01:56:30.86Z" }, - { url = "https://files.pythonhosted.org/packages/2c/28/172a588415c48b2eb2eccabbfb3e21c5c95ddeb1022ca96b5fde75c5f71a/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fdb58f30ec64ae44268baa58fcf01f0fdfba44c3153591c8b76a16a57df44ee4", size = 14582792, upload_time = "2026-08-07T01:56:34.052Z" }, - { url = "https://files.pythonhosted.org/packages/fa/8f/c7211d118a5dfb08e24655ff5c4414fda0b281de64cf83834da9fd1bbcd2/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c4e6e3c80416636666d2a9cbca0fd32dbba51e54da4e7a5a6ba3388bfbacf612", size = 14106287, upload_time = "2026-08-07T01:56:37.073Z" }, - { url = "https://files.pythonhosted.org/packages/d5/f4/642addd2e33daf1cc2357150db5c6ab6a81bd378281203552d5e509c6f02/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1672be7086ae54d8dfce02eb612894c3ad51c42e03b4769d0e45a9d9e622d4ed", size = 14617068, upload_time = "2026-08-07T01:56:39.913Z" }, - { url = "https://files.pythonhosted.org/packages/3b/17/e4a7c0f6ded01370f3267058f5bb2a10487d200dc5a29058fbff34aa9820/pyrefly-1.3.0.dev1-py3-none-win32.whl", hash = "sha256:7dd496f3642bba6764f3c4c9f189ef021a30fc05261087316e4d6bb9beace65e", size = 13403475, upload_time = "2026-08-07T01:56:42.782Z" }, - { url = "https://files.pythonhosted.org/packages/61/79/2a366f1b65c177e42f67b8540e7372e258d0880eed957859bbf5b1ff7d0e/pyrefly-1.3.0.dev1-py3-none-win_amd64.whl", hash = "sha256:70baea8d7577be7f50a5dbbf5819f5cb335208e97793846e14d80ebd8f90f6c4", size = 14264341, upload_time = "2026-08-07T01:56:45.772Z" }, - { url = "https://files.pythonhosted.org/packages/c8/f9/abe77e5154b1c56d60831aade2d4b6e9e9d2c458860e5fd9fc30a2fc720e/pyrefly-1.3.0.dev1-py3-none-win_arm64.whl", hash = "sha256:d5070fecbe7b22eaf46b1da510fe5ea3c69b17f805dfbc04753d9501ce24f54e", size = 13607012, upload_time = "2026-08-07T01:56:48.638Z" }, + { url = "https://files.pythonhosted.org/packages/ba/6a/ca1ea8084f000ecbf7d6a2a8cde3f2d6f437d0d527f5f0bda0a383fb011f/pyrefly-1.3.0.dev1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:327e245a54357794954a7788d22dd446b90dcc403d0d82414b0b20b6fa37648c", size = 14210092, upload-time = "2026-08-07T01:56:17.895Z" }, + { url = "https://files.pythonhosted.org/packages/a2/df/0f405798d99900a6809483db0262c820ccccdf13b379789d9280d848b9a0/pyrefly-1.3.0.dev1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:00e5d88265c5e3088ac566dd4cf542a13f93e76f7672b738c1306d5d5cae6123", size = 13639017, upload-time = "2026-08-07T01:56:21.181Z" }, + { url = "https://files.pythonhosted.org/packages/4b/28/a41e1daab805124cdefc46566251555bbe0caf24668a851393971eb5cbd7/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c2dcce81731dcc0dcd199b6b0117ebd3df2ee1fc4910f508cb84aa7615182f28", size = 14084976, upload-time = "2026-08-07T01:56:24.551Z" }, + { url = "https://files.pythonhosted.org/packages/df/9c/985e6ab05ab7927d5f6eb8420958957b707f8fbdcb012001b967286a46cc/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56a855f5784978e990effe760e0eaab60b98a0add9bebb79af901d9a8269696d", size = 15230694, upload-time = "2026-08-07T01:56:27.722Z" }, + { url = "https://files.pythonhosted.org/packages/55/73/1368adde6c6f29bd88d5929211291a17c4cf9bddaafd0a3ab330d463ed10/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a0e36aede58dffab44a67ac0f322e416d0fa4955c80d491fc7e0fe80c1a73a5d", size = 15170348, upload-time = "2026-08-07T01:56:30.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/28/172a588415c48b2eb2eccabbfb3e21c5c95ddeb1022ca96b5fde75c5f71a/pyrefly-1.3.0.dev1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fdb58f30ec64ae44268baa58fcf01f0fdfba44c3153591c8b76a16a57df44ee4", size = 14582792, upload-time = "2026-08-07T01:56:34.052Z" }, + { url = "https://files.pythonhosted.org/packages/fa/8f/c7211d118a5dfb08e24655ff5c4414fda0b281de64cf83834da9fd1bbcd2/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c4e6e3c80416636666d2a9cbca0fd32dbba51e54da4e7a5a6ba3388bfbacf612", size = 14106287, upload-time = "2026-08-07T01:56:37.073Z" }, + { url = "https://files.pythonhosted.org/packages/d5/f4/642addd2e33daf1cc2357150db5c6ab6a81bd378281203552d5e509c6f02/pyrefly-1.3.0.dev1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1672be7086ae54d8dfce02eb612894c3ad51c42e03b4769d0e45a9d9e622d4ed", size = 14617068, upload-time = "2026-08-07T01:56:39.913Z" }, + { url = "https://files.pythonhosted.org/packages/3b/17/e4a7c0f6ded01370f3267058f5bb2a10487d200dc5a29058fbff34aa9820/pyrefly-1.3.0.dev1-py3-none-win32.whl", hash = "sha256:7dd496f3642bba6764f3c4c9f189ef021a30fc05261087316e4d6bb9beace65e", size = 13403475, upload-time = "2026-08-07T01:56:42.782Z" }, + { url = "https://files.pythonhosted.org/packages/61/79/2a366f1b65c177e42f67b8540e7372e258d0880eed957859bbf5b1ff7d0e/pyrefly-1.3.0.dev1-py3-none-win_amd64.whl", hash = "sha256:70baea8d7577be7f50a5dbbf5819f5cb335208e97793846e14d80ebd8f90f6c4", size = 14264341, upload-time = "2026-08-07T01:56:45.772Z" }, + { url = "https://files.pythonhosted.org/packages/c8/f9/abe77e5154b1c56d60831aade2d4b6e9e9d2c458860e5fd9fc30a2fc720e/pyrefly-1.3.0.dev1-py3-none-win_arm64.whl", hash = "sha256:d5070fecbe7b22eaf46b1da510fe5ea3c69b17f805dfbc04753d9501ce24f54e", size = 13607012, upload-time = "2026-08-07T01:56:48.638Z" }, ] [[package]] @@ -186,52 +186,52 @@ dependencies = [ { name = "nodeenv" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/10/53/e4d8ea1391bd4355231be6f91bf239479aa0014260ed3fb5526eeb12a1f2/pyright-1.1.410.tar.gz", hash = "sha256:07a073b8ba6749826773c1269773efa11b93440d9a6aa60419d9a3172d6dc488", size = 4062013, upload_time = "2026-06-01T17:35:48.894Z" } +sdist = { url = "https://files.pythonhosted.org/packages/10/53/e4d8ea1391bd4355231be6f91bf239479aa0014260ed3fb5526eeb12a1f2/pyright-1.1.410.tar.gz", hash = "sha256:07a073b8ba6749826773c1269773efa11b93440d9a6aa60419d9a3172d6dc488", size = 4062013, upload-time = "2026-06-01T17:35:48.894Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d7/33/288b5868fa00846dacf249633719d747893e54aebd196b9968ac1878a5d3/pyright-1.1.410-py3-none-any.whl", hash = "sha256:5e961bed37cacf96b3f7cd7b1da39b350a9239aa2e69138d0e88f728cfaf296c", size = 6082448, upload_time = "2026-06-01T17:35:46.387Z" }, + { url = "https://files.pythonhosted.org/packages/d7/33/288b5868fa00846dacf249633719d747893e54aebd196b9968ac1878a5d3/pyright-1.1.410-py3-none-any.whl", hash = "sha256:5e961bed37cacf96b3f7cd7b1da39b350a9239aa2e69138d0e88f728cfaf296c", size = 6082448, upload-time = "2026-06-01T17:35:46.387Z" }, ] [[package]] name = "tomlkit" version = "0.14.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c3/af/14b24e41977adb296d6bd1fb59402cf7d60ce364f90c890bd2ec65c43b5a/tomlkit-0.14.0.tar.gz", hash = "sha256:cf00efca415dbd57575befb1f6634c4f42d2d87dbba376128adb42c121b87064", size = 187167, upload_time = "2026-01-13T01:14:53.304Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/af/14b24e41977adb296d6bd1fb59402cf7d60ce364f90c890bd2ec65c43b5a/tomlkit-0.14.0.tar.gz", hash = "sha256:cf00efca415dbd57575befb1f6634c4f42d2d87dbba376128adb42c121b87064", size = 187167, upload-time = "2026-01-13T01:14:53.304Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl", hash = "sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680", size = 39310, upload_time = "2026-01-13T01:14:51.965Z" }, + { url = "https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl", hash = "sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680", size = 39310, upload-time = "2026-01-13T01:14:51.965Z" }, ] [[package]] name = "ty" version = "0.0.67" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d3/aa/e153d47aef36891729ff2a7dd7350d04df73f81ef8117257b518c771956e/ty-0.0.67.tar.gz", hash = "sha256:8926130a1d5a11b228f72bc6a7680cf4f75be99064dfe3ad161fd3b860999603", size = 6550079, upload_time = "2026-08-05T18:43:21.18Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d3/aa/e153d47aef36891729ff2a7dd7350d04df73f81ef8117257b518c771956e/ty-0.0.67.tar.gz", hash = "sha256:8926130a1d5a11b228f72bc6a7680cf4f75be99064dfe3ad161fd3b860999603", size = 6550079, upload-time = "2026-08-05T18:43:21.18Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/fd/0a/992067ee1bdd30994c0dbdb3674e88a9ea7892dd6008a819c73f9985a1b6/ty-0.0.67-py3-none-linux_armv6l.whl", hash = "sha256:5ad41198feb7d3963f954902d3b33c58b5dc27bd21f4d9cde45dd1ae1ba34677", size = 12353546, upload_time = "2026-08-05T18:42:42.137Z" }, - { url = "https://files.pythonhosted.org/packages/a2/8c/def24d99c4a4e1bfc30ce6d69a913a9bf6bfa8a56fe2b1b3d6bce7e75bdd/ty-0.0.67-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:90f8271d66d0a42bd5f3aab01c51acf70dc7111fe8ffe62c9125a2db1a4f8a55", size = 12023201, upload_time = "2026-08-05T18:42:44.944Z" }, - { url = "https://files.pythonhosted.org/packages/99/11/03c2278fb76f764439045760c11ac7bd407bc534c13138ccc21d60e5d883/ty-0.0.67-py3-none-macosx_11_0_arm64.whl", hash = "sha256:df5d5b4496036fffe3f767691867b57bc67fc2155e9608cb4fcb517dfe4f5761", size = 11522878, upload_time = "2026-08-05T18:42:47.192Z" }, - { url = "https://files.pythonhosted.org/packages/03/47/d4d4e334649db69d7467084aedf02f237b852a8ffba4579d0d193a50dda5/ty-0.0.67-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de4f90d9152051a697d59f354f30eb76c3e9ec608e2a3c33595bbc88f851ad4e", size = 12093398, upload_time = "2026-08-05T18:42:49.331Z" }, - { url = "https://files.pythonhosted.org/packages/db/24/a551f16dfcd89ff4173757f09f3bb6cb9aa10e6f079c604b949a9c19ba41/ty-0.0.67-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bccc2361d1f628182ca19b1736c947ca082e7db5f07277a43b316241e07b1350", size = 12141027, upload_time = "2026-08-05T18:42:51.528Z" }, - { url = "https://files.pythonhosted.org/packages/c5/87/9e2baa098b94ea0bce4e3e8b106711a500af50be50519b96e90484e4f4b8/ty-0.0.67-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0d7eee4a9d7694d64085a8ae12b4d9fc7c162b24e3000befe91737a9a61d1dd", size = 12908208, upload_time = "2026-08-05T18:42:53.844Z" }, - { url = "https://files.pythonhosted.org/packages/42/32/e8c0bfc19cc0a6dbf254933c13b857c2c0c800b86158296d3e4ccdb5702c/ty-0.0.67-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f4309acef52659fb5e030962b60fccd44b4f6b9c19c365738bc5d46a3c138b1e", size = 13404183, upload_time = "2026-08-05T18:42:55.988Z" }, - { url = "https://files.pythonhosted.org/packages/a3/ab/c9faa04a075136741b173058dd81a4070dc0bdf7fe162f8278d61e1b0b3d/ty-0.0.67-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4daffa097226bcdee4852b61bd05311a49a7286b10042c148450cf6761b287c7", size = 13127241, upload_time = "2026-08-05T18:42:58.826Z" }, - { url = "https://files.pythonhosted.org/packages/a7/e5/47a368bdee8fd8376b6055496b5d2d03650d976b94e924b39332c0861396/ty-0.0.67-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94b579b8ee3836238b96fb186a99904eea0a56685d6e50f7b54fe530050df07d", size = 12685060, upload_time = "2026-08-05T18:43:01.487Z" }, - { url = "https://files.pythonhosted.org/packages/ce/2d/b78102ca16dd05be36defe18f312deba43606c8870638749908de58b6408/ty-0.0.67-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:3b357d66119c4dc11d7508c40df0338857e470b0041515781effc45ca9211294", size = 12959319, upload_time = "2026-08-05T18:43:03.712Z" }, - { url = "https://files.pythonhosted.org/packages/88/e6/35e5a6d887144463d93c1320558fe6027e02c2cd27658999af04abf56120/ty-0.0.67-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:24043b96d25b9b787b715c08ed7c8bc236cb7800a6fd189967092b9712f523c9", size = 12040267, upload_time = "2026-08-05T18:43:05.91Z" }, - { url = "https://files.pythonhosted.org/packages/69/26/2d81626e029e5fa6a9b03e98141dbf52a6e6b814130e5d7227cbb9b74611/ty-0.0.67-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4384d7427e1abf5165e010b66d2133d38b2707ef8880eb755de25f2e5b69a3f1", size = 12153207, upload_time = "2026-08-05T18:43:08.039Z" }, - { url = "https://files.pythonhosted.org/packages/df/62/cc61afedad6e8f02303cf2867364d5b30f2f223787c58932870c53e99d65/ty-0.0.67-py3-none-musllinux_1_2_i686.whl", hash = "sha256:761a141c6f6833b62bc5d92558b243adfd11b8084e070aa112c9b7ab9ec90e8b", size = 12446021, upload_time = "2026-08-05T18:43:10.207Z" }, - { url = "https://files.pythonhosted.org/packages/25/c4/8bbc1c641018b4003bb9fdc1a93843055dfa8d771b4d08fb6413b7a94a5a/ty-0.0.67-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:fc80a63d0b9eecc667e16e809d20a1c014668e6be8523db1f7714bc1a84e79c4", size = 12797108, upload_time = "2026-08-05T18:43:12.244Z" }, - { url = "https://files.pythonhosted.org/packages/c9/a4/8b181be30a49f6813822d50e7489eb8fe6287db7f2b635d1de97f82bbf94/ty-0.0.67-py3-none-win32.whl", hash = "sha256:9dc697547cc7972079e77d716b6874fbe7c6e7265d360ba372afdf44f0a103ec", size = 11771788, upload_time = "2026-08-05T18:43:14.375Z" }, - { url = "https://files.pythonhosted.org/packages/a6/bc/948eb72740c23c0ab3bb0a3bb07035e25d7950e862fd987651a8a6f21430/ty-0.0.67-py3-none-win_amd64.whl", hash = "sha256:2c4cdc1dffbfab5476bd708adb90018dd3f8bc796b3608fd60162b6e9c85981a", size = 12818447, upload_time = "2026-08-05T18:43:16.607Z" }, - { url = "https://files.pythonhosted.org/packages/5e/0a/8a2002aed7e4cf7278141984b393b5156e7f42c8aefc9ced9d037a3a3cd9/ty-0.0.67-py3-none-win_arm64.whl", hash = "sha256:6251e59bf4c36486204a0ec3aa758f7b65ef6727f1db7b24b8e90db072ac6eff", size = 12146254, upload_time = "2026-08-05T18:43:18.915Z" }, + { url = "https://files.pythonhosted.org/packages/fd/0a/992067ee1bdd30994c0dbdb3674e88a9ea7892dd6008a819c73f9985a1b6/ty-0.0.67-py3-none-linux_armv6l.whl", hash = "sha256:5ad41198feb7d3963f954902d3b33c58b5dc27bd21f4d9cde45dd1ae1ba34677", size = 12353546, upload-time = "2026-08-05T18:42:42.137Z" }, + { url = "https://files.pythonhosted.org/packages/a2/8c/def24d99c4a4e1bfc30ce6d69a913a9bf6bfa8a56fe2b1b3d6bce7e75bdd/ty-0.0.67-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:90f8271d66d0a42bd5f3aab01c51acf70dc7111fe8ffe62c9125a2db1a4f8a55", size = 12023201, upload-time = "2026-08-05T18:42:44.944Z" }, + { url = "https://files.pythonhosted.org/packages/99/11/03c2278fb76f764439045760c11ac7bd407bc534c13138ccc21d60e5d883/ty-0.0.67-py3-none-macosx_11_0_arm64.whl", hash = "sha256:df5d5b4496036fffe3f767691867b57bc67fc2155e9608cb4fcb517dfe4f5761", size = 11522878, upload-time = "2026-08-05T18:42:47.192Z" }, + { url = "https://files.pythonhosted.org/packages/03/47/d4d4e334649db69d7467084aedf02f237b852a8ffba4579d0d193a50dda5/ty-0.0.67-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de4f90d9152051a697d59f354f30eb76c3e9ec608e2a3c33595bbc88f851ad4e", size = 12093398, upload-time = "2026-08-05T18:42:49.331Z" }, + { url = "https://files.pythonhosted.org/packages/db/24/a551f16dfcd89ff4173757f09f3bb6cb9aa10e6f079c604b949a9c19ba41/ty-0.0.67-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bccc2361d1f628182ca19b1736c947ca082e7db5f07277a43b316241e07b1350", size = 12141027, upload-time = "2026-08-05T18:42:51.528Z" }, + { url = "https://files.pythonhosted.org/packages/c5/87/9e2baa098b94ea0bce4e3e8b106711a500af50be50519b96e90484e4f4b8/ty-0.0.67-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0d7eee4a9d7694d64085a8ae12b4d9fc7c162b24e3000befe91737a9a61d1dd", size = 12908208, upload-time = "2026-08-05T18:42:53.844Z" }, + { url = "https://files.pythonhosted.org/packages/42/32/e8c0bfc19cc0a6dbf254933c13b857c2c0c800b86158296d3e4ccdb5702c/ty-0.0.67-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f4309acef52659fb5e030962b60fccd44b4f6b9c19c365738bc5d46a3c138b1e", size = 13404183, upload-time = "2026-08-05T18:42:55.988Z" }, + { url = "https://files.pythonhosted.org/packages/a3/ab/c9faa04a075136741b173058dd81a4070dc0bdf7fe162f8278d61e1b0b3d/ty-0.0.67-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4daffa097226bcdee4852b61bd05311a49a7286b10042c148450cf6761b287c7", size = 13127241, upload-time = "2026-08-05T18:42:58.826Z" }, + { url = "https://files.pythonhosted.org/packages/a7/e5/47a368bdee8fd8376b6055496b5d2d03650d976b94e924b39332c0861396/ty-0.0.67-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94b579b8ee3836238b96fb186a99904eea0a56685d6e50f7b54fe530050df07d", size = 12685060, upload-time = "2026-08-05T18:43:01.487Z" }, + { url = "https://files.pythonhosted.org/packages/ce/2d/b78102ca16dd05be36defe18f312deba43606c8870638749908de58b6408/ty-0.0.67-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:3b357d66119c4dc11d7508c40df0338857e470b0041515781effc45ca9211294", size = 12959319, upload-time = "2026-08-05T18:43:03.712Z" }, + { url = "https://files.pythonhosted.org/packages/88/e6/35e5a6d887144463d93c1320558fe6027e02c2cd27658999af04abf56120/ty-0.0.67-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:24043b96d25b9b787b715c08ed7c8bc236cb7800a6fd189967092b9712f523c9", size = 12040267, upload-time = "2026-08-05T18:43:05.91Z" }, + { url = "https://files.pythonhosted.org/packages/69/26/2d81626e029e5fa6a9b03e98141dbf52a6e6b814130e5d7227cbb9b74611/ty-0.0.67-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4384d7427e1abf5165e010b66d2133d38b2707ef8880eb755de25f2e5b69a3f1", size = 12153207, upload-time = "2026-08-05T18:43:08.039Z" }, + { url = "https://files.pythonhosted.org/packages/df/62/cc61afedad6e8f02303cf2867364d5b30f2f223787c58932870c53e99d65/ty-0.0.67-py3-none-musllinux_1_2_i686.whl", hash = "sha256:761a141c6f6833b62bc5d92558b243adfd11b8084e070aa112c9b7ab9ec90e8b", size = 12446021, upload-time = "2026-08-05T18:43:10.207Z" }, + { url = "https://files.pythonhosted.org/packages/25/c4/8bbc1c641018b4003bb9fdc1a93843055dfa8d771b4d08fb6413b7a94a5a/ty-0.0.67-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:fc80a63d0b9eecc667e16e809d20a1c014668e6be8523db1f7714bc1a84e79c4", size = 12797108, upload-time = "2026-08-05T18:43:12.244Z" }, + { url = "https://files.pythonhosted.org/packages/c9/a4/8b181be30a49f6813822d50e7489eb8fe6287db7f2b635d1de97f82bbf94/ty-0.0.67-py3-none-win32.whl", hash = "sha256:9dc697547cc7972079e77d716b6874fbe7c6e7265d360ba372afdf44f0a103ec", size = 11771788, upload-time = "2026-08-05T18:43:14.375Z" }, + { url = "https://files.pythonhosted.org/packages/a6/bc/948eb72740c23c0ab3bb0a3bb07035e25d7950e862fd987651a8a6f21430/ty-0.0.67-py3-none-win_amd64.whl", hash = "sha256:2c4cdc1dffbfab5476bd708adb90018dd3f8bc796b3608fd60162b6e9c85981a", size = 12818447, upload-time = "2026-08-05T18:43:16.607Z" }, + { url = "https://files.pythonhosted.org/packages/5e/0a/8a2002aed7e4cf7278141984b393b5156e7f42c8aefc9ced9d037a3a3cd9/ty-0.0.67-py3-none-win_arm64.whl", hash = "sha256:6251e59bf4c36486204a0ec3aa758f7b65ef6727f1db7b24b8e90db072ac6eff", size = 12146254, upload-time = "2026-08-05T18:43:18.915Z" }, ] [[package]] name = "types-markdown" version = "3.10.2.20260508" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/24/62/4ca11db82799590117d9b6ef8fcd6515039cff80838304face5440f7d95c/types_markdown-3.10.2.20260508.tar.gz", hash = "sha256:64c405a30decd46cf78443bbcde8331f561f83752cc6d962ff3f5ccaabe26a8e", size = 19818, upload_time = "2026-05-08T04:49:45.095Z" } +sdist = { url = "https://files.pythonhosted.org/packages/24/62/4ca11db82799590117d9b6ef8fcd6515039cff80838304face5440f7d95c/types_markdown-3.10.2.20260508.tar.gz", hash = "sha256:64c405a30decd46cf78443bbcde8331f561f83752cc6d962ff3f5ccaabe26a8e", size = 19818, upload-time = "2026-05-08T04:49:45.095Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cf/9d/eae7125bcf063ff5f79aadad58f3d37675263941f84e025bf53de1735fe1/types_markdown-3.10.2.20260508-py3-none-any.whl", hash = "sha256:2ee5e462c7b821c27c3d8f75f4da873d3e3c87d24d7f2d741f8f4261e4024a99", size = 25811, upload_time = "2026-05-08T04:49:43.962Z" }, + { url = "https://files.pythonhosted.org/packages/cf/9d/eae7125bcf063ff5f79aadad58f3d37675263941f84e025bf53de1735fe1/types_markdown-3.10.2.20260508-py3-none-any.whl", hash = "sha256:2ee5e462c7b821c27c3d8f75f4da873d3e3c87d24d7f2d741f8f4261e4024a99", size = 25811, upload-time = "2026-05-08T04:49:43.962Z" }, ] [[package]] @@ -242,9 +242,9 @@ dependencies = [ { name = "importlib-resources" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/85/7d/62fbae352d5fb7ce5ef4d9ca73bf7a9b02b790d2524ab6ef1e0e799a5d1b/typeshed_client-2.11.0.tar.gz", hash = "sha256:0b8f2ab88f611f5e97b70d2a8123942d3d7d5c74cee8ae694db83422f32f9481", size = 522774, upload_time = "2026-05-01T14:51:52.38Z" } +sdist = { url = "https://files.pythonhosted.org/packages/85/7d/62fbae352d5fb7ce5ef4d9ca73bf7a9b02b790d2524ab6ef1e0e799a5d1b/typeshed_client-2.11.0.tar.gz", hash = "sha256:0b8f2ab88f611f5e97b70d2a8123942d3d7d5c74cee8ae694db83422f32f9481", size = 522774, upload-time = "2026-05-01T14:51:52.38Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4f/22/fa16b462157bd869dfad528f5637506b9430ca63d48fb536ecf4cc78481a/typeshed_client-2.11.0-py3-none-any.whl", hash = "sha256:5745e0990b80b29a286b22d68f81779c5c7adf1cac8969eeafba44b73b486c36", size = 787609, upload_time = "2026-05-01T14:51:51.005Z" }, + { url = "https://files.pythonhosted.org/packages/4f/22/fa16b462157bd869dfad528f5637506b9430ca63d48fb536ecf4cc78481a/typeshed_client-2.11.0-py3-none-any.whl", hash = "sha256:5745e0990b80b29a286b22d68f81779c5c7adf1cac8969eeafba44b73b486c36", size = 787609, upload-time = "2026-05-01T14:51:51.005Z" }, ] [[package]] @@ -280,11 +280,11 @@ requires-dist = [ [[package]] name = "typing-extensions" -version = "4.15.0" +version = "4.16.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload_time = "2025-08-25T13:49:26.313Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload_time = "2025-08-25T13:49:24.86Z" }, + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, ] [[package]] @@ -292,16 +292,16 @@ name = "zuban" version = "0.8.2" source = { registry = "https://pypi.org/simple" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/d8/9a24dc2c22250fc416bff06c4ac4664c73ef7ec558b8d23049f493af73b5/zuban-0.8.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:07d3a498c514cb51ec881987b0e841043ea466674a9b3bed8411890bacb4d0e3", size = 11486917, upload_time = "2026-06-08T23:29:02.829Z" }, - { url = "https://files.pythonhosted.org/packages/23/62/3636a5474a9f9361ca83030cb82fefb4b1ff7771c75ab957c9025a3a7a97/zuban-0.8.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:64ed57aea375c74671d81e4d4655328a47b2157c7827e2c50cc90f80b29e8417", size = 11205360, upload_time = "2026-06-08T23:29:05.612Z" }, - { url = "https://files.pythonhosted.org/packages/49/41/0650f89e1f2ea0e865dd5e23614e6f3a205153032f0a9e970c5f4da885d1/zuban-0.8.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8bc47f343a939407ff881b0e9f0da36c7a3a509b3e6ca237512aadf30d02053b", size = 28385720, upload_time = "2026-06-08T23:29:08.177Z" }, - { url = "https://files.pythonhosted.org/packages/d7/52/58ecbdbf9668fd81c85f69b94609a5a813a94a18d9ce73ee1548cf85d98d/zuban-0.8.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26ede2418f48affde0e9092108ec0be344b1323d7e87d11ecac8e5e89d383d7e", size = 28603725, upload_time = "2026-06-08T23:29:11.778Z" }, - { url = "https://files.pythonhosted.org/packages/96/ad/efc2e98a4492d010459161e03f98952227744c8f5ae8ebcc13ca88d50ad6/zuban-0.8.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b83e0cc35cccb2f60b50d8c6658ca3ac332914ad58d8e3d3d5886a13f761771b", size = 29769216, upload_time = "2026-06-08T23:29:14.865Z" }, - { url = "https://files.pythonhosted.org/packages/f7/60/a40add4cf31694f64727a34fc4a2093c599f1c911fdb6fbf61bf40d437f5/zuban-0.8.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c4b26c1a383234c340d4956c04d8528e5e1654a08571d9d3eaced4973d21f87", size = 30851896, upload_time = "2026-06-08T23:29:18.04Z" }, - { url = "https://files.pythonhosted.org/packages/17/6f/7e32ec7c1677dfd7ac5821ac1d6cc6d4552f65fe06b098bd3515f5c5699d/zuban-0.8.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:32699e64acdb7d8984eddc3095b8f6fcf37fa00c52d54e74fed920440fe36ebe", size = 28551589, upload_time = "2026-06-08T23:29:20.922Z" }, - { url = "https://files.pythonhosted.org/packages/68/26/f5e8434aa8ea478a949b4dab8bd94abb47ff46f4777943a3309c33bfda94/zuban-0.8.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f2ada854ceddeae6f7a8ecf709577235f5845770ebd6d51b26dde4358e78b645", size = 29007499, upload_time = "2026-06-08T23:29:23.954Z" }, - { url = "https://files.pythonhosted.org/packages/5c/37/70e6696e0e9d202fa84be8437b9dbf32e6d5854d9a201b9ca24965496391/zuban-0.8.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:dd6c2be104e6e9e1693e15d0a7775c5841a9793534351738c24b7377c58b487c", size = 29670474, upload_time = "2026-06-08T23:29:26.769Z" }, - { url = "https://files.pythonhosted.org/packages/74/0c/1c6f0a239fc2c93c46e733fa5d6f9ac376f9e0aec909467d50f6071234bf/zuban-0.8.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:299debc250b729abb0ebecd0bd53cac3c6b26cdb32dc4e79e601f9a1f584d3cd", size = 29029010, upload_time = "2026-06-08T23:29:29.959Z" }, - { url = "https://files.pythonhosted.org/packages/a6/7b/d5cdb140e9979d3f7784d9565f21692cafb851cceb21cba13348bcfcfa30/zuban-0.8.2-py3-none-win32.whl", hash = "sha256:3521196b132c2650e01a085d211dfcd849de9e9409e193e8f8ad85629c60fa42", size = 10026570, upload_time = "2026-06-08T23:29:32.596Z" }, - { url = "https://files.pythonhosted.org/packages/ee/cb/25a952a3594aa7ee32dee648513a1ea758c2def98742966d24484bb3d8ab/zuban-0.8.2-py3-none-win_amd64.whl", hash = "sha256:07463d337d293efb918990900c52b976646810b8f741999e8f288fb3da6e6594", size = 10798493, upload_time = "2026-06-08T23:29:34.805Z" }, + { url = "https://files.pythonhosted.org/packages/95/d8/9a24dc2c22250fc416bff06c4ac4664c73ef7ec558b8d23049f493af73b5/zuban-0.8.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:07d3a498c514cb51ec881987b0e841043ea466674a9b3bed8411890bacb4d0e3", size = 11486917, upload-time = "2026-06-08T23:29:02.829Z" }, + { url = "https://files.pythonhosted.org/packages/23/62/3636a5474a9f9361ca83030cb82fefb4b1ff7771c75ab957c9025a3a7a97/zuban-0.8.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:64ed57aea375c74671d81e4d4655328a47b2157c7827e2c50cc90f80b29e8417", size = 11205360, upload-time = "2026-06-08T23:29:05.612Z" }, + { url = "https://files.pythonhosted.org/packages/49/41/0650f89e1f2ea0e865dd5e23614e6f3a205153032f0a9e970c5f4da885d1/zuban-0.8.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8bc47f343a939407ff881b0e9f0da36c7a3a509b3e6ca237512aadf30d02053b", size = 28385720, upload-time = "2026-06-08T23:29:08.177Z" }, + { url = "https://files.pythonhosted.org/packages/d7/52/58ecbdbf9668fd81c85f69b94609a5a813a94a18d9ce73ee1548cf85d98d/zuban-0.8.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26ede2418f48affde0e9092108ec0be344b1323d7e87d11ecac8e5e89d383d7e", size = 28603725, upload-time = "2026-06-08T23:29:11.778Z" }, + { url = "https://files.pythonhosted.org/packages/96/ad/efc2e98a4492d010459161e03f98952227744c8f5ae8ebcc13ca88d50ad6/zuban-0.8.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b83e0cc35cccb2f60b50d8c6658ca3ac332914ad58d8e3d3d5886a13f761771b", size = 29769216, upload-time = "2026-06-08T23:29:14.865Z" }, + { url = "https://files.pythonhosted.org/packages/f7/60/a40add4cf31694f64727a34fc4a2093c599f1c911fdb6fbf61bf40d437f5/zuban-0.8.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c4b26c1a383234c340d4956c04d8528e5e1654a08571d9d3eaced4973d21f87", size = 30851896, upload-time = "2026-06-08T23:29:18.04Z" }, + { url = "https://files.pythonhosted.org/packages/17/6f/7e32ec7c1677dfd7ac5821ac1d6cc6d4552f65fe06b098bd3515f5c5699d/zuban-0.8.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:32699e64acdb7d8984eddc3095b8f6fcf37fa00c52d54e74fed920440fe36ebe", size = 28551589, upload-time = "2026-06-08T23:29:20.922Z" }, + { url = "https://files.pythonhosted.org/packages/68/26/f5e8434aa8ea478a949b4dab8bd94abb47ff46f4777943a3309c33bfda94/zuban-0.8.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f2ada854ceddeae6f7a8ecf709577235f5845770ebd6d51b26dde4358e78b645", size = 29007499, upload-time = "2026-06-08T23:29:23.954Z" }, + { url = "https://files.pythonhosted.org/packages/5c/37/70e6696e0e9d202fa84be8437b9dbf32e6d5854d9a201b9ca24965496391/zuban-0.8.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:dd6c2be104e6e9e1693e15d0a7775c5841a9793534351738c24b7377c58b487c", size = 29670474, upload-time = "2026-06-08T23:29:26.769Z" }, + { url = "https://files.pythonhosted.org/packages/74/0c/1c6f0a239fc2c93c46e733fa5d6f9ac376f9e0aec909467d50f6071234bf/zuban-0.8.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:299debc250b729abb0ebecd0bd53cac3c6b26cdb32dc4e79e601f9a1f584d3cd", size = 29029010, upload-time = "2026-06-08T23:29:29.959Z" }, + { url = "https://files.pythonhosted.org/packages/a6/7b/d5cdb140e9979d3f7784d9565f21692cafb851cceb21cba13348bcfcfa30/zuban-0.8.2-py3-none-win32.whl", hash = "sha256:3521196b132c2650e01a085d211dfcd849de9e9409e193e8f8ad85629c60fa42", size = 10026570, upload-time = "2026-06-08T23:29:32.596Z" }, + { url = "https://files.pythonhosted.org/packages/ee/cb/25a952a3594aa7ee32dee648513a1ea758c2def98742966d24484bb3d8ab/zuban-0.8.2-py3-none-win_amd64.whl", hash = "sha256:07463d337d293efb918990900c52b976646810b8f741999e8f288fb3da6e6594", size = 10798493, upload-time = "2026-06-08T23:29:34.805Z" }, ] diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 088d8c892..e9447bd6f 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -2782,8 +2782,9 @@ Since ``lower`` is assignable to ``upper``, ``T3`` is covariant. Auto Variance For TypeVar ^^^^^^^^^^^^^^^^^^^^^^^^^ -The existing ``TypeVar`` class constructor accepts keyword parameters named -``covariant`` and ``contravariant``. If both of these are ``False``, the +The existing ``TypeVar``, ``TypeVarTuple`` and ``ParamSpec`` class constructors +accepts keyword parameters named ``covariant`` and ``contravariant``. +If both of these are ``False``, the type variable is assumed to be invariant. PEP 695 adds another keyword parameter named ``infer_variance`` indicating that a type checker should use inference to determine whether the type variable is invariant, covariant or