Skip to content

WIP: checks annotations of assignments, refs #11582 #11611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

WIP: checks annotations of assignments, refs #11582 #11611

wants to merge 2 commits into from

Conversation

sobolevn
Copy link
Member

It requires a lot more work, but the basic case from the issue works:

from typing import TypeAlias

AMONGUS: TypeAlias = "int"
IMPOSTER: TypeAlias = "str"

a: AMONGUS | IMPOSTER = 0
reveal_type(a)

Output:

out/ex.py:6: error: Unsupported left operand type for | ("str")
out/ex.py:7: note: Revealed type is "Union[builtins.int, builtins.str]"

Closes #11582

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

jax (https://github.com/google/jax.git)
+ jax/_src/dispatch.py:104: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
- jax/_src/dispatch.py:104: error: Variable "jax._src.dispatch.Device" is not valid as a type  [valid-type]
- jax/_src/dispatch.py:104: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- jax/_src/dispatch.py:374: error: Variable "jax._src.dispatch.Device" is not valid as a type  [valid-type]
- jax/_src/dispatch.py:374: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- jax/_src/dispatch.py:381: error: Variable "jax._src.dispatch.Device" is not valid as a type  [valid-type]
- jax/_src/dispatch.py:381: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- jax/_src/dispatch.py:412: error: Variable "jax._src.dispatch.XlaExecutable" is not valid as a type  [valid-type]
- jax/_src/dispatch.py:412: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- jax/_src/dispatch.py:430: error: Variable "jax._src.dispatch.XlaExecutable" is not valid as a type  [valid-type]
- jax/_src/dispatch.py:430: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- jax/_src/dispatch.py:453: error: Variable "jax._src.dispatch.Device" is not valid as a type  [valid-type]
- jax/_src/dispatch.py:453: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- jax/_src/dispatch.py:592: error: Variable "jax._src.dispatch.Device" is not valid as a type  [valid-type]
- jax/_src/dispatch.py:592: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- jax/_src/dispatch.py:602: error: Variable "jax._src.dispatch.Device" is not valid as a type  [valid-type]
- jax/_src/dispatch.py:602: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- jax/_src/dispatch.py:626: error: Variable "jax._src.dispatch.Device" is not valid as a type  [valid-type]
- jax/_src/dispatch.py:626: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- jax/_src/dispatch.py:654: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
+ jax/interpreters/xla.py:157: error: Variable "jax.interpreters.xla.XlaShape" is not valid as a type  [valid-type]
+ jax/interpreters/xla.py:157: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases

mypy (https://github.com/python/mypy.git)
+ mypyc/ir/class_ir.py:115: error: "dict" is not subscriptable  [misc]
+ mypyc/ir/class_ir.py:120: error: "dict" is not subscriptable  [misc]
+ mypyc/ir/class_ir.py:122: error: "dict" is not subscriptable  [misc]
+ mypyc/ir/class_ir.py:133: error: "dict" is not subscriptable  [misc]
+ mypyc/ir/class_ir.py:136: error: "dict" is not subscriptable  [misc]
+ mypyc/ir/class_ir.py:140: error: "dict" is not subscriptable  [misc]
+ mypy/options.py:249: error: "dict" is not subscriptable  [misc]
- mypy/fastparse2.py:1010: error: Argument 2 to "visit_Ellipsis" becomes "Any" due to an unfollowed import  [no-any-unimported]
- mypy/fastparse2.py:1014: error: Argument 2 to "visit_Attribute" becomes "Any" due to an unfollowed import  [no-any-unimported]
- mypy/fastparse2.py:1030: error: Argument 2 to "visit_Subscript" becomes "Any" due to an unfollowed import  [no-any-unimported]
- mypy/fastparse2.py:1040: error: Argument 2 to "visit_Name" becomes "Any" due to an unfollowed import  [no-any-unimported]
- mypy/fastparse2.py:1045: error: Argument 2 to "visit_List" becomes "Any" due to an unfollowed import  [no-any-unimported]
- mypy/fastparse2.py:1055: error: Argument 2 to "visit_Tuple" becomes "Any" due to an unfollowed import  [no-any-unimported]
- mypy/fastparse2.py:1062: error: Argument 2 to "visit_Slice" becomes "Any" due to an unfollowed import  [no-any-unimported]
- mypy/fastparse2.py:1068: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
+ mypy/fastparse2.py:1010: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)

rotki (https://github.com/rotki/rotki)
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:53: error: Variable "rotkehlchen.typing.ChecksumEthAddress" is not valid as a type
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:53: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:54: error: Variable "rotkehlchen.typing.ChecksumEthAddress" is not valid as a type
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:54: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:55: error: Variable "rotkehlchen.typing.ChecksumEthAddress" is not valid as a type
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:55: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:55: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
+ rotkehlchen/chain/ethereum/modules/balancer/typing.py:61: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:61: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:62: error: Variable "rotkehlchen.typing.ChecksumEthAddress" is not valid as a type
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:62: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:71: error: Variable "rotkehlchen.typing.ChecksumEthAddress" is not valid as a type
- rotkehlchen/chain/ethereum/modules/balancer/typing.py:71: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases

xarray (https://github.com/pydata/xarray.git)
+ xarray/core/computation.py:1747: error: "dict" is not subscriptable  [misc]

ibis (https://github.com/ibis-project/ibis.git)
+ ibis/config.py:38: error: "dict" is not subscriptable
+ ibis/config.py:40: error: "dict" is not subscriptable
+ ibis/backends/base/__init__.py:137: error: Value of type "Type[type]" is not indexable
+ ibis/expr/analysis.py:562: error: Type expected within [...]
+ ibis/expr/analysis.py:562: error: Value of type "Type[Dict[Any, Any]]" is not indexable
+ ibis/expr/analysis.py:562: error: Unsupported left operand type for | ("Type[Expr]")
+ ibis/expr/analysis.py:563: error: "list" is not subscriptable
+ ibis/backends/clickhouse/__init__.py:17: error: Unsupported left operand type for | ("Type[str]")
+ ibis/backends/sqlite/__init__.py:31: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
- ibis/backends/sqlite/__init__.py:31: error: Incompatible types in assignment (expression has type "Type[Database]", base class "BaseAlchemyBackend" defined the type as "Type[AlchemyDatabase]")
- ibis/backends/sqlite/__init__.py:84: error: "Backend" has no attribute "con"
- ibis/backends/sqlite/__init__.py:124: error: "Backend" has no attribute "meta"
- ibis/backends/impala/tests/test_kudu_support.py:15: error: Module "ibis.backends.impala.tests.conftest" has no attribute "ImpalaE2E"

pandas (https://github.com/pandas-dev/pandas.git)
+ pandas/core/shared_docs.py:3: error: "dict" is not subscriptable  [misc]
+ pandas/core/ops/docstrings.py:297: error: Type expected within [...]  [misc]
+ pandas/core/ops/docstrings.py:297: error: Value of type "Type[Dict[Any, Any]]" is not indexable  [index]
+ pandas/core/ops/docstrings.py:297: error: Unsupported left operand type for | ("Type[str]")  [operator]
+ pandas/core/groupby/base.py:41: error: "frozenset" is not subscriptable  [misc]
+ pandas/core/groupby/base.py:48: error: "frozenset" is not subscriptable  [misc]
+ pandas/util/version/__init__.py:136: error: Unsupported left operand type for | ("object")  [operator]
+ pandas/util/version/__init__.py:281: error: "list" is not subscriptable  [misc]
+ pandas/util/version/__init__.py:403: error: "tuple" is not subscriptable  [misc]
+ pandas/util/version/__init__.py:408: error: "tuple" is not subscriptable  [misc]
+ pandas/util/version/__init__.py:408: error: Type application has too many types (1 expected)  [misc]
+ pandas/_config/config.py:86: error: "dict" is not subscriptable  [misc]
+ pandas/_config/config.py:89: error: "dict" is not subscriptable  [misc]
+ pandas/_config/config.py:92: error: "dict" is not subscriptable  [misc]
+ pandas/_config/config.py:95: error: "list" is not subscriptable  [misc]
- pandas/_libs/lib.pyi:167: error: Variable "pandas._libs.lib.ndarray_obj_2d" is not valid as a type  [valid-type]
- pandas/_libs/lib.pyi:167: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- pandas/_libs/lib.pyi:170: error: Variable "pandas._libs.lib.ndarray_obj_2d" is not valid as a type  [valid-type]
- pandas/_libs/lib.pyi:170: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- pandas/_libs/lib.pyi:173: error: Variable "pandas._libs.lib.ndarray_obj_2d" is not valid as a type  [valid-type]
- pandas/_libs/lib.pyi:173: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- pandas/_libs/lib.pyi:174: error: Variable "pandas._libs.lib.ndarray_obj_2d" is not valid as a type  [valid-type]
- pandas/_libs/lib.pyi:174: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ pandas/core/util/numba_.py:14: error: "dict" is not subscriptable  [misc]
+ pandas/core/util/numba_.py:14: error: "tuple" is not subscriptable  [misc]
+ pandas/core/dtypes/base.py:100: error: "tuple" is not subscriptable  [misc]
+ pandas/core/dtypes/dtypes.py:85: error: "tuple" is not subscriptable  [misc]
+ pandas/core/dtypes/dtypes.py:90: error: "dict" is not subscriptable  [misc]
+ pandas/core/dtypes/dtypes.py:180: error: "dict" is not subscriptable  [misc]
+ pandas/core/dtypes/dtypes.py:673: error: "dict" is not subscriptable  [misc]
+ pandas/core/dtypes/dtypes.py:839: error: "dict" is not subscriptable  [misc]
+ pandas/core/dtypes/dtypes.py:1057: error: "dict" is not subscriptable  [misc]
+ pandas/core/accessor.py:16: error: "set" is not subscriptable  [misc]
+ pandas/core/accessor.py:17: error: "frozenset" is not subscriptable  [misc]
+ pandas/io/common.py:100: error: Type expected within [...]  [misc]
- pandas/io/common.py:724: error: No overload variant of "BZ2File" matches argument types "Union[str, BaseBuffer]", "str", "Dict[str, Any]"  [call-overload]
- pandas/io/common.py:724: note: Possible overload variants:
- pandas/io/common.py:724: note:     def __init__(self, filename: _WritableFileobj, mode: Union[Literal['w'], Literal['wb'], Literal['x'], Literal['xb'], Literal['a'], Literal['ab']], buffering: Optional[Any] = ..., compresslevel: int = ...) -> BZ2File
- pandas/io/common.py:724: note:     def __init__(self, filename: _ReadableFileobj, mode: Union[Literal[''], Literal['r'], Literal['rb']] = ..., buffering: Optional[Any] = ..., compresslevel: int = ...) -> BZ2File
- pandas/io/common.py:724: note:     def __init__(self, filename: Union[str, bytes, PathLike[str], PathLike[bytes]], mode: Union[Union[Literal[''], Literal['r'], Literal['rb']], Union[Literal['w'], Literal['wb'], Literal['x'], Literal['xb'], Literal['a'], Literal['ab']]] = ..., buffering: Optional[Any] = ..., compresslevel: int = ...) -> BZ2File
- pandas/core/indexers/utils.py:357: error: <nothing> has no attribute "stop"  [attr-defined]
- pandas/core/indexers/utils.py:357: error: <nothing> has no attribute "start"  [attr-defined]
- pandas/core/indexers/utils.py:357: error: <nothing> has no attribute "step"  [attr-defined]
- pandas/core/dtypes/cast.py:448: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/dtypes/cast.py:1065: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/dtypes/cast.py:1924: error: Item "None" of "Optional[Any]" has no attribute "kind"  [union-attr]
+ pandas/compat/numpy/function.py:119: error: Type expected within [...]  [misc]
+ pandas/compat/numpy/function.py:132: error: Type expected within [...]  [misc]
+ pandas/compat/numpy/function.py:155: error: "dict" is not subscriptable  [misc]
+ pandas/compat/numpy/function.py:176: error: "dict" is not subscriptable  [misc]
+ pandas/compat/numpy/function.py:201: error: Type expected within [...]  [misc]
+ pandas/compat/numpy/function.py:224: error: "dict" is not subscriptable  [misc]
+ pandas/compat/numpy/function.py:229: error: "dict" is not subscriptable  [misc]
+ pandas/compat/numpy/function.py:234: error: "dict" is not subscriptable  [misc]
+ pandas/compat/numpy/function.py:239: error: Type expected within [...]  [misc]
+ pandas/compat/numpy/function.py:245: error: Type expected within [...]  [misc]
+ pandas/compat/numpy/function.py:279: error: Type expected within [...]  [misc]
+ pandas/compat/numpy/function.py:285: error: Type expected within [...]  [misc]
- pandas/core/common.py:132: error: <nothing> has no attribute "dtype"  [attr-defined]
- pandas/core/common.py:399: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/array_algos/take.py:47: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
+ pandas/core/computation/expr.py:394: error: "tuple" is not subscriptable  [misc]
+ pandas/core/algorithms.py:108: error: "dict" is not subscriptable  [misc]
- pandas/core/algorithms.py:1536: error: Redundant cast to "Union[ExtensionArray, Any]"  [redundant-cast]
+ pandas/core/ops/__init__.py:80: error: "set" is not subscriptable  [misc]
+ pandas/core/ops/__init__.py:100: error: "set" is not subscriptable  [misc]
+ pandas/core/computation/expressions.py:26: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/base.py:98: error: "dict" is not subscriptable  [misc]
- pandas/core/arrays/base.py:543: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/base.py:547: error: Overloaded function signature 3 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/datetimelike.py:321: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [misc]
+ pandas/core/arrays/datetimelike.py:162: error: "tuple" is not subscriptable  [misc]
+ pandas/core/arrays/datetimelike.py:164: error: "tuple" is not subscriptable  [misc]
- pandas/core/arrays/datetimelike.py:1844: error: Incompatible types in assignment (expression has type "Union[Union[Period, Timestamp, Timedelta], NaTType]", variable has type "TimelikeOps")  [assignment]
+ pandas/core/arrays/period.py:170: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/period.py:171: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/period.py:172: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/period.py:173: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/period.py:192: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/period.py:193: error: "list" is not subscriptable  [misc]
+ pandas/core/base.py:85: error: "dict" is not subscriptable  [misc]
+ pandas/core/base.py:102: error: "dict" is not subscriptable  [misc]
+ pandas/core/base.py:193: error: "frozenset" is not subscriptable  [misc]
+ pandas/core/base.py:283: error: "frozenset" is not subscriptable  [misc]
+ pandas/core/strings/accessor.py:51: error: "dict" is not subscriptable  [misc]
- pandas/core/base.py:1248: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/tools/numeric.py:206: error: Item "None" of "Optional[str]" has no attribute "index"  [union-attr]
- pandas/core/tools/numeric.py:207: error: Value of type "Optional[str]" is not indexable  [index]
+ pandas/core/strings/accessor.py:2912: error: "dict" is not subscriptable  [misc]
+ pandas/core/indexes/base.py:185: error: "dict" is not subscriptable  [misc]
+ pandas/core/indexes/base.py:193: error: "dict" is not subscriptable  [misc]
+ pandas/core/indexes/base.py:306: error: "frozenset" is not subscriptable  [misc]
+ pandas/core/indexes/base.py:369: error: "list" is not subscriptable  [misc]
+ pandas/core/indexes/base.py:370: error: "list" is not subscriptable  [misc]
- pandas/core/indexes/base.py:6764: error: Item "ExtensionArray" of "Union[ExtensionArray, Any]" has no attribute "min"  [union-attr]
- pandas/core/indexes/base.py:6790: error: Item "ExtensionArray" of "Union[ExtensionArray, Any]" has no attribute "max"  [union-attr]
+ pandas/core/arrays/timedeltas.py:136: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/timedeltas.py:137: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/timedeltas.py:138: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/timedeltas.py:139: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/timedeltas.py:140: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/timedeltas.py:141: error: "list" is not subscriptable  [misc]
- pandas/core/arrays/string_arrow.py:266: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [misc]
- pandas/core/arrays/masked.py:372: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/masked.py:376: error: Overloaded function signature 3 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/interval.py:645: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [misc]
+ pandas/core/arrays/interval.py:99: error: "dict" is not subscriptable  [misc]
- pandas/core/arrays/interval.py:956: error: Incompatible types in assignment (expression has type "Union[Any, float]", variable has type "IntervalArray")  [assignment]
- pandas/core/arrays/interval.py:958: error: List item 1 has incompatible type "Union[Any, float]"; expected "IntervalArray"  [list-item]
- pandas/core/arrays/interval.py:1143: error: Item "float" of "Union[Any, float]" has no attribute "__iter__" (not iterable)  [union-attr]
- pandas/core/arrays/interval.py:1144: error: Item "float" of "Union[Any, float]" has no attribute "__iter__" (not iterable)  [union-attr]
+ pandas/core/arrays/integer.py:534: error: "dict" is not subscriptable  [misc]
- pandas/core/arrays/integer.py:346: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/integer.py:350: error: Overloaded function signature 3 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/floating.py:278: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/floating.py:282: error: Overloaded function signature 3 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/datetimes.py:482: error: Incompatible types in assignment (expression has type "Union[Union[Period, Timestamp, Timedelta], NaTType]", variable has type "DatetimeArray")  [assignment]
- pandas/core/arrays/datetimes.py:486: error: Incompatible types in assignment (expression has type "Union[Union[Period, Timestamp, Timedelta], NaTType]", variable has type "DatetimeArray")  [assignment]
- pandas/core/arrays/datetimes.py:488: error: Incompatible types in assignment (expression has type "Union[Union[Period, Timestamp, Timedelta], NaTType]", variable has type "DatetimeArray")  [assignment]
+ pandas/core/arrays/datetimes.py:196: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/datetimes.py:205: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/datetimes.py:206: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/datetimes.py:226: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/datetimes.py:227: error: "list" is not subscriptable  [misc]
+ pandas/core/arrays/datetimes.py:228: error: "list" is not subscriptable  [misc]
- pandas/core/arrays/categorical.py:493: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/categorical.py:497: error: Overloaded function signature 3 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/boolean.py:374: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/boolean.py:378: error: Overloaded function signature 3 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/core/arrays/sparse/array.py:956: error: Argument 1 to "len" has incompatible type "Union[Union[Union[int, Any], Union[slice, List[int], Any]], Tuple[Union[int, ellipsis], ...]]"; expected "Sized"  [arg-type]
- pandas/core/arrays/sparse/array.py:1550: error: Cannot call function of unknown type  [operator]
+ pandas/plotting/_core.py:1760: error: "dict" is not subscriptable  [misc]
+ pandas/core/indexes/numeric.py:97: error: "tuple" is not subscriptable  [misc]
- pandas/core/indexes/multi.py:330: error: Incompatible types in assignment (expression has type "List[None]", variable has type "FrozenList")  [assignment]
- pandas/core/indexes/multi.py:555: error: ndarray_obj_2d? has no attribute "T"  [attr-defined]
- pandas/core/indexes/multi.py:557: error: ndarray_obj_2d? has no attribute "T"  [attr-defined]
+ pandas/core/computation/pytables.py:43: error: "dict" is not subscriptable  [misc]
+ pandas/core/computation/pytables.py:103: error: "dict" is not subscriptable  [misc]
+ pandas/core/computation/pytables.py:266: error: "tuple" is not subscriptable  [misc]
+ pandas/core/indexes/category.py:50: error: "dict" is not subscriptable  [misc]
+ pandas/core/computation/engines.py:140: error: "dict" is not subscriptable  [misc]
+ pandas/core/indexes/datetimelike.py:95: error: "list" is not subscriptable  [misc]
+ pandas/core/indexes/datetimelike.py:96: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
- pandas/core/tools/datetimes.py:628: error: Overloaded function signatures 1 and 3 overlap with incompatible return types  [misc]
- pandas/core/tools/datetimes.py:645: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [misc]
- pandas/io/pytables.py:3357: error: Argument 1 to "enumerate" has incompatible type "Optional[Any]"; expected "Iterable[Any]"  [arg-type]
- pandas/io/pytables.py:3358: error: Value of type "Optional[Any]" is not indexable  [index]
- pandas/io/pytables.py:3600: error: Argument 1 to "_dtype_to_kind" has incompatible type "Optional[Any]"; expected "str"  [arg-type]
- pandas/io/parsers/python_parser.py:983: error: ndarray_obj_2d? has no attribute "T"  [attr-defined]
- pandas/core/frame.py:1407: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [misc]
- pandas/core/window/rolling.py:1127: error: "None" not callable  [misc]
- pandas/core/internals/managers.py:167: error: "BaseBlockManager" has no attribute "_rebuild_blknos_and_blklocs"  [attr-defined]
- pandas/core/internals/managers.py:178: error: "BaseBlockManager" has no attribute "_rebuild_blknos_and_blklocs"  [attr-defined]
- pandas/core/internals/array_manager.py:308: error: Item "ExtensionArray" of "Union[Any, ExtensionArray]" has no attribute "_data"  [union-attr]
- pandas/compat/pickle_compat.py:272: error: "Unpickler" has no attribute "is_verbose"  [attr-defined]
- pandas/core/groupby/ops.py:282: error: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader  [misc]
- pandas/tests/resample/test_datetime_index.py:1773: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)

porcupine (https://github.com/Akuli/porcupine.git)
+ porcupine/plugins/run/windows_run.py:17: error: Unsupported left operand type for | ("Type[int]")  [operator]
+ porcupine/utils.py:137: error: "dict" is not subscriptable  [misc]
+ porcupine/utils.py:456: error: "deque" is not subscriptable  [misc]
+ porcupine/utils.py:460: error: Unsupported left operand type for | ("Type[Event[Any]]")  [operator]
+ porcupine/utils.py:737: error: Unsupported left operand type for | ("Type[str]")  [operator]
+ porcupine/textutils.py:98: error: "list" is not subscriptable  [misc]
+ porcupine/textutils.py:98: error: Unsupported left operand type for | ("Type[List[Any]]")  [operator]
+ porcupine/textutils.py:559: error: "dict" is not subscriptable  [misc]
+ porcupine/tabs.py:28: error: "dict" is not subscriptable  [misc]
+ porcupine/tabs.py:28: error: "list" is not subscriptable  [misc]
+ porcupine/tabs.py:92: error: "list" is not subscriptable  [misc]
+ porcupine/tabs.py:92: error: "tuple" is not subscriptable  [misc]
+ porcupine/tabs.py:440: error: Unsupported left operand type for | ("Type[Path]")  [operator]
+ porcupine/tabs.py:441: error: Unsupported left operand type for | ("Type[str]")  [operator]
+ porcupine/tabs.py:442: error: Type expected within [...]  [misc]
+ porcupine/tabs.py:442: error: The type "Type[Tuple[Any, ...]]" is not generic and not indexable  [misc]
+ porcupine/tabs.py:442: error: Unsupported left operand type for | ("Type[stat_result]")  [operator]
+ porcupine/tabs.py:444: error: "dict" is not subscriptable  [misc]
+ porcupine/_state.py:26: error: Unsupported left operand type for | ("Type[_State]")  [operator]
+ porcupine/_state.py:27: error: "dict" is not subscriptable  [misc]
+ porcupine/images/__init__.py:12: error: "list" is not subscriptable  [misc]
+ porcupine/images/__init__.py:30: error: "dict" is not subscriptable  [misc]
+ porcupine/settings.py:119: error: "dict" is not subscriptable  [misc]
+ porcupine/settings.py:120: error: "dict" is not subscriptable  [misc]
+ porcupine/settings.py:494: error: Unsupported left operand type for | ("Type[Frame]")  [operator]
+ porcupine/_logs.py:75: error: "list" is not subscriptable  [misc]
+ porcupine/plugins/statusbar.py:31: error: "list" is not subscriptable  [misc]
+ porcupine/plugins/statusbar.py:31: error: "tuple" is not subscriptable  [misc]
+ porcupine/plugins/longlinemarker.py:60: error: "list" is not subscriptable  [misc]
+ porcupine/plugins/linenumbers.py:35: error: Unsupported left operand type for | ("Type[str]")  [operator]
+ porcupine/plugins/hover.py:19: error: Unsupported left operand type for | ("Type[Label]")  [operator]
+ porcupine/plugins/highlight.py:87: error: "dict" is not subscriptable  [misc]
+ porcupine/plugins/highlight.py:87: error: "list" is not subscriptable  [misc]
+ porcupine/plugins/editorconfig.py:35: error: "dict" is not subscriptable  [misc]
+ porcupine/plugins/editorconfig.py:188: error: "list" is not subscriptable  [misc]
+ porcupine/plugins/editorconfig.py:214: error: "dict" is not subscriptable  [misc]
+ porcupine/plugins/editorconfig.py:311: error: Type expected within [...]  [misc]
+ porcupine/plugins/editorconfig.py:311: error: Value of type "Type[Dict[Any, Any]]" is not indexable  [index]
+ porcupine/plugins/editorconfig.py:311: error: Unsupported left operand type for | ("Type[object]")  [operator]
+ porcupine/plugins/autocomplete.py:98: error: "list" is not subscriptable  [misc]
+ porcupine/plugins/autocomplete.py:98: error: Unsupported left operand type for | ("Type[List[Any]]")  [operator]
+ porcupine/plugins/autocomplete.py:337: error: Unsupported left operand type for | ("Type[str]")  [operator]
+ porcupine/plugins/autocomplete.py:339: error: Unsupported left operand type for | ("Type[int]")  [operator]
+ porcupine/plugins/run/common.py:41: error: Unsupported left operand type for | ("Type[str]")  [operator]
+ porcupine/plugins/run/common.py:42: error: "list" is not subscriptable  [misc]
+ porcupine/plugins/__init__.py:13: error: "list" is not subscriptable  [misc]
+ more_plugins/pythonprompt.py:49: error: Type expected within [...]  [misc]
+ more_plugins/pythonprompt.py:49: error: The type "Type[Queue[Any]]" is not generic and not indexable  [misc]
+ more_plugins/pythonprompt.py:49: error: The type "Type[Tuple[Any, ...]]" is not generic and not indexable  [misc]
+ more_plugins/pythonprompt.py:49: error: Unsupported left operand type for | ("Type[int]")  [operator]
+ porcupine/pluginloader.py:121: error: Unsupported left operand type for | ("object")  [operator]
+ porcupine/pluginloader.py:122: error: Unsupported left operand type for | ("Type[str]")  [operator]
+ porcupine/pluginloader.py:125: error: "list" is not subscriptable  [misc]
+ porcupine/pluginloader.py:127: error: "dict" is not subscriptable  [misc]
+ porcupine/pluginloader.py:127: error: "set" is not subscriptable  [misc]
+ porcupine/pluginloader.py:179: error: "list" is not subscriptable  [misc]
+ porcupine/plugins/underlines.py:37: error: "dict" is not subscriptable  [misc]
+ porcupine/plugins/pastebin.py:64: error: Unsupported left operand type for | ("Type[socket]")  [operator]
+ porcupine/plugins/pa```

@sobolevn
Copy link
Member Author

Ooof 😞

 ==== 433 failed, 9146 passed, 374 skipped, 7 xfailed in 1270.56s (0:21:10) ====
ERROR: InvocationError for command 'D:\a\mypy\mypy\.tox\py37\Scripts\python.EXE' -m pytest (exited with code 1)
___________________________________ summary ___________________________________
ERROR:   py37: commands failed

@hauntsaninja hauntsaninja marked this pull request as draft February 24, 2022 21:47
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No error on new union syntax with union of fake types (TypeAlias and None)
1 participant