Skip to content
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

Alternative implementation of PEP 673 #13133

Closed
wants to merge 43 commits into from

Conversation

Gobot1234
Copy link
Contributor

Description

Alternative implementation of #11666. This piggy backs off of TypeVar but doesn't add a new node for TypeVar (which was the original issue with this idea yonks ago)

Test Plan

I'm going to wait for mypy primer to be mostly done before working the unit tests

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@PerchunPak
Copy link

Why do you need to wait for mypy primer before working on the unit tests? Looks like mypy primer already gives enough info, plus tests also give a lot of spam.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@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:

pyinstrument (https://github.com/joerick/pyinstrument)
- pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[Self, Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]
- pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[Self, Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]

aiortc (https://github.com/aiortc/aiortc)
- src/aiortc/rtcrtpreceiver.py:498: error: Invalid index type "Union[int, str, None]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]
+ src/aiortc/rtcrtpreceiver.py:498: error: Invalid index type "Union[int, str]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]
- src/aiortc/rtcpeerconnection.py:92: error: Invalid index type "Union[int, str, None]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]
+ src/aiortc/rtcpeerconnection.py:92: error: Invalid index type "Union[int, str]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]

operator (https://github.com/canonical/operator)
- ops/framework.py:445: error: Argument 1 to "_track" of "Framework" has incompatible type "Object"; expected "_Serializable"  [arg-type]
+ ops/framework.py:445: error: Argument 1 to "_track" of "Framework" has incompatible type "Self"; expected "_Serializable"  [arg-type]
- ops/framework.py:445: note: "Object" is missing following "_Serializable" protocol members:
- ops/framework.py:445: note:     restore, snapshot
- ops/framework.py:1069: error: Invalid signature "Callable[[BoundStoredState, Literal['on']], ObjectEvents]" for "__getattr__"  [misc]
+ ops/framework.py:1069: error: Invalid signature "Callable[[Self, Literal['on']], ObjectEvents]" for "__getattr__"  [misc]

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- pandas-stubs/core/strings.pyi:42: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [misc]
- pandas-stubs/_libs/tslibs/timestamps.pyi:167: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [misc]
+ tests/test_frame.py:253: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:253: error: No overload variant of "drop" of "DataFrame" matches argument type "List[str]"  [call-overload]
+ tests/test_frame.py:253: note: Possible overload variants:
+ tests/test_frame.py:253: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:253: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:253: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:254: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:254: error: No overload variant of "drop" of "DataFrame" matches argument type "List[int]"  [call-overload]
+ tests/test_frame.py:254: note: Possible overload variants:
+ tests/test_frame.py:254: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:254: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:254: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:255: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:255: error: No overload variant of "drop" of "DataFrame" matches argument type "List[int]"  [call-overload]
+ tests/test_frame.py:255: note: Possible overload variants:
+ tests/test_frame.py:255: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:255: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:255: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:256: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:256: error: No overload variant of "drop" of "DataFrame" matches argument type "List[str]"  [call-overload]
+ tests/test_frame.py:256: note: Possible overload variants:
+ tests/test_frame.py:256: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:256: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:256: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:259: error: Expression is of type "Any", not "None"  [assert-type]
+ tests/test_frame.py:259: error: No overload variant of "drop" of "DataFrame" matches argument types "List[int]", "bool"  [call-overload]
+ tests/test_frame.py:259: note: Possible overload variants:
+ tests/test_frame.py:259: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:259: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:259: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:261: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:261: error: No overload variant of "drop" of "DataFrame" matches argument type "List[str]"  [call-overload]
+ tests/test_frame.py:261: note: Possible overload variants:
+ tests/test_frame.py:261: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:261: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:261: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/dependencies/data.py:89: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/dependencies/data.py:89: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/dependencies/data.py:95: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/dependencies/data.py:95: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:228: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:228: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:310: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:310: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:927: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:927: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:931: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:931: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:935: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:935: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:1346: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:1346: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:1688: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:1688: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:1785: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:1785: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2050: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2050: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2054: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2054: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2123: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2123: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2174: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2174: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2222: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2222: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2270: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2270: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2403: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2403: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2407: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2407: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2411: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2411: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2421: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2421: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2436: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2436: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2451: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2451: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2471: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2471: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2599: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2599: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2654: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2654: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2669: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2669: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2775: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2775: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2790: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2790: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2831: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2831: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2835: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2835: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2839: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2839: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2921: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2921: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2936: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2936: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2957: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2957: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2997: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2997: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3012: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3012: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3146: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3146: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3163: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3163: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3178: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3178: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3222: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3222: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3237: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3237: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3288: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3288: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3303: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3303: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3354: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3354: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3371: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3371: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3420: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3420: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3424: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3424: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4069: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4069: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4086: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4086: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4116: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4116: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4139: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4139: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4157: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4157: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4218: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4218: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4277: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4277: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4299: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4299: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4495: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4495: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4548: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4548: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4618: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4618: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4670: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4670: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4729: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4729: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4761: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4761: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4781: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4781: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4813: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4813: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:115: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:115: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:119: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:124: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:124: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:153: error: Returning Any from function declared to return Self?  [no-any-return]
- tanjun/hooks.py:160: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:160: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:165: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:165: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:187: error: Returning Any from function declared to return Self?  [no-any-return]
- tanjun/hooks.py:194: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:194: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:199: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:199: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:218: error: Returning Any from function declared to return Self?  [no-any-return]
- tanjun/hooks.py:225: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:225: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:230: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:230: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:249: error: Returning Any from function declared to return Self?  [no-any-return]
- tanjun/hooks.py:256: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:256: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:261: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:261: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:280: error: Returning Any from function declared to return Self?  [no-any-return]
- tanjun/dependencies/locales.py:114: error: Only concrete class can be given where "Type[AbstractLocaliser]" is expected  [type-abstract]
- tanjun/dependencies/locales.py:143: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/dependencies/locales.py:143: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/context/base.py:119: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/context/base.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/context/base.py:130: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/context/base.py:130: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ tanjun/components.py:109: error: Argument 1 has incompatible type "object"; expected "_CommandT"  [arg-type]
+ tanjun/components.py:111: error: Argument 1 to "collect_wrapped" has incompatible type "object"; expected "ExecutableCommand[Any]"  [arg-type]
- tanjun/components.py:323: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:323: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:340: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:340: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:344: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:344: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:352: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:352: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:422: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:422: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:448: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:448: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:468: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:468: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:489: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:489: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:494: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:494: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:510: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:510: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- 

... (truncated 2520 lines) ...

@github-actions
Copy link
Contributor

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

pyinstrument (https://github.com/joerick/pyinstrument)
- pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[Self, Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]
- pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[Self, Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]

aiortc (https://github.com/aiortc/aiortc)
- src/aiortc/rtcrtpreceiver.py:498: error: Invalid index type "Union[int, str, None]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]
+ src/aiortc/rtcrtpreceiver.py:498: error: Invalid index type "Union[int, str]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]
- src/aiortc/rtcpeerconnection.py:92: error: Invalid index type "Union[int, str, None]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]
+ src/aiortc/rtcpeerconnection.py:92: error: Invalid index type "Union[int, str]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]

operator (https://github.com/canonical/operator)
- ops/framework.py:445: error: Argument 1 to "_track" of "Framework" has incompatible type "Object"; expected "_Serializable"  [arg-type]
+ ops/framework.py:445: error: Argument 1 to "_track" of "Framework" has incompatible type "Self"; expected "_Serializable"  [arg-type]
- ops/framework.py:445: note: "Object" is missing following "_Serializable" protocol members:
- ops/framework.py:445: note:     restore, snapshot
- ops/framework.py:1069: error: Invalid signature "Callable[[BoundStoredState, Literal['on']], ObjectEvents]" for "__getattr__"  [misc]
+ ops/framework.py:1069: error: Invalid signature "Callable[[Self, Literal['on']], ObjectEvents]" for "__getattr__"  [misc]

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- pandas-stubs/core/strings.pyi:42: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [misc]
- pandas-stubs/_libs/tslibs/timestamps.pyi:167: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [misc]
+ tests/test_frame.py:253: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:253: error: No overload variant of "drop" of "DataFrame" matches argument type "List[str]"  [call-overload]
+ tests/test_frame.py:253: note: Possible overload variants:
+ tests/test_frame.py:253: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:253: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:253: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:254: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:254: error: No overload variant of "drop" of "DataFrame" matches argument type "List[int]"  [call-overload]
+ tests/test_frame.py:254: note: Possible overload variants:
+ tests/test_frame.py:254: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:254: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:254: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:255: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:255: error: No overload variant of "drop" of "DataFrame" matches argument type "List[int]"  [call-overload]
+ tests/test_frame.py:255: note: Possible overload variants:
+ tests/test_frame.py:255: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:255: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:255: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:256: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:256: error: No overload variant of "drop" of "DataFrame" matches argument type "List[str]"  [call-overload]
+ tests/test_frame.py:256: note: Possible overload variants:
+ tests/test_frame.py:256: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:256: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:256: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:259: error: Expression is of type "Any", not "None"  [assert-type]
+ tests/test_frame.py:259: error: No overload variant of "drop" of "DataFrame" matches argument types "List[int]", "bool"  [call-overload]
+ tests/test_frame.py:259: note: Possible overload variants:
+ tests/test_frame.py:259: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:259: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:259: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:261: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:261: error: No overload variant of "drop" of "DataFrame" matches argument type "List[str]"  [call-overload]
+ tests/test_frame.py:261: note: Possible overload variants:
+ tests/test_frame.py:261: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:261: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:261: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]

urllib3 (https://github.com/urllib3/urllib3)
+ /tmp/mypy_primer/projects/_urllib3_venv/lib/python3.10/site-packages/tornado/tcpserver.py:391: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
+ https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
+ Please report a bug at https://github.com/python/mypy/issues
+ version: 0.990+dev.56a220911c8d4846b80b90d4791af4a774e3100a
- test/with_dummyserver/test_https.py:463: error: Unused "type: ignore" comment
- test/with_dummyserver/test_https.py:784: error: Unused "type: ignore" comment
+ Traceback (most recent call last):
+   File "", line 8, in <module>
+     sys.exit(console_entry())
+   File "/__main__.py", line 15, in console_entry
+     main()
+   File "/main.py", line 95, in main
+     res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
+   File "/main.py", line 174, in run_build
+     res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
+   File "/build.py", line 193, in build
+     result = _build(
+   File "/build.py", line 276, in _build
+     graph = dispatch(sources, manager, stdout)
+   File "/build.py", line 2903, in dispatch
+     process_graph(graph, manager)
+   File "/build.py", line 3287, in process_graph
+     process_stale_scc(graph, scc, manager)
+   File "/build.py", line 3388, in process_stale_scc
+     graph[id].type_check_first_pass()
+   File "/build.py", line 2309, in type_check_first_pass
+     self.type_checker().check_first_pass()
+   File "/checker.py", line 466, in check_first_pass
+     self.accept(d)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 1143, in accept
+     return visitor.visit_class_def(self)
+   File "/checker.py", line 2133, in visit_class_def
+     self.accept(defn.defs)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 1218, in accept
+     return visitor.visit_block(self)
+   File "/checker.py", line 2570, in visit_block
+     self.accept(s)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 822, in accept
+     return visitor.visit_func_def(self)
+   File "/checker.py", line 939, in visit_func_def
+     self._visit_func_def(defn)
+   File "/checker.py", line 943, in _visit_func_def
+     self.check_func_item(defn, name=defn.name)
+   File "/checker.py", line 1012, in check_func_item
+     self.check_func_def(defn, typ, name, allow_empty)
+   File "/checker.py", line 1209, in check_func_def
+     self.accept(item.body)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 1218, in accept
+     return visitor.visit_block(self)
+   File "/checker.py", line 2570, in visit_block
+     self.accept(s)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 1516, in accept
+     return visitor.visit_try_stmt(self)
+   File "/checker.py", line 4272, in visit_try_stmt
+     self.visit_try_without_finally(s, try_frame=bool(s.finally_body))
+   File "/checker.py", line 4308, in visit_try_without_finally
+     self.accept(s.body)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 1218, in accept
+     return visitor.visit_block(self)
+   File "/checker.py", line 2570, in visit_block
+     self.accept(s)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 1468, in accept
+     return visitor.visit_if_stmt(self)
+   File "/checker.py", line 4179, in visit_if_stmt
+     self.accept(b)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 1218, in accept
+     return visitor.visit_block(self)
+   File "/checker.py", line 2570, in visit_block
+     self.accept(s)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 1236, in accept
+     return visitor.visit_expression_stmt(self)
+   File "/checker.py", line 4056, in visit_expression_stmt
+     expr_type = self.expr_checker.accept(s.expr, allow_none_return=True, always_allow_any=True)
+   File "/checkexpr.py", line 4661, in accept
+     typ = self.visit_call_expr(node, allow_none_return=True)
+   File "/checkexpr.py", line 411, in visit_call_expr
+     return self.visit_call_expr_inner(e, allow_none_return=allow_none_return)
+   File "/checkexpr.py", line 531, in visit_call_expr_inner
+     ret_type = self.check_call_expr_with_callee_type(
+   File "/checkexpr.py", line 1182, in check_call_expr_with_callee_type
+     ret_type, callee_type = self.check_call(
+   File "/checkexpr.py", line 1265, in check_call
+     return self.check_callable_call(
+   File "/checkexpr.py", line 1407, in check_callable_call
+     callee = self.infer_function_type_arguments(
+   File "/checkexpr.py", line 1706, in infer_function_type_arguments
+     arg_types = self.infer_arg_types_in_context(
+   File "/checkexpr.py", line 1601, in infer_arg_types_in_context
+     res[ai] = self.accept(args[ai], callee.arg_types[i])
+   File "/checkexpr.py", line 4669, in accept
+     typ = node.accept(self)
+   File "/nodes.py", line 2100, in accept
+     return visitor.visit_lambda_expr(self)
+   File "/checkexpr.py", line 4211, in visit_lambda_expr
+     self.chk.check_func_item(e, type_override=type_override)
+   File "/checker.py", line 1012, in check_func_item
+     self.check_func_def(defn, typ, name, allow_empty)
+   File "/checker.py", line 1209, in check_func_def
+     self.accept(item.body)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 1218, in accept
+     return visitor.visit_block(self)
+   File "/checker.py", line 2570, in visit_block
+     self.accept(s)
+   File "/checker.py", line 574, in accept
+     stmt.accept(self)
+   File "/nodes.py", line 1402, in accept
+     return visitor.visit_return_stmt(self)
+   File "/checker.py", line 4067, in visit_return_stmt
+     self.check_return_stmt(s)
+   File "/checker.py", line 4101, in check_return_stmt
+     self.expr_checker.accept(
+   File "/checkexpr.py", line 4661, in accept
+     typ = self.visit_call_expr(node, allow_none_return=True)
+   File "/checkexpr.py", line 411, in visit_call_expr
+     return self.visit_call_expr_inner(e, allow_none_return=allow_none_return)
+   File "/checkexpr.py", line 531, in visit_call_expr_inner
+     ret_type = self.check_call_expr_with_callee_type(
+   File "/checkexpr.py", line 1182, in check_call_expr_with_callee_type
+     ret_type, callee_type = self.check_call(
+   File "/checkexpr.py", line 1265, in check_call
+     return self.check_callable_call(
+   File "/checkexpr.py", line 1405, in check_callable_call
+     callee = freshen_function_type_vars(callee)
+   File "/expandtype.py", line 123, in freshen_function_type_vars
+     fresh = cast(CallableType, expand_type(callee, tvmap)).copy_modified(variables=tvs)
+   File "/expandtype.py", line 56, in expand_type
+     return typ.accept(ExpandTypeVisitor(env))
+   File "/types.py", line 1830, in accept
+     return visitor.visit_callable_type(self)
+   File "/expandtype.py", line 271, in visit_callable_type
+     ret_type=t.ret_type.accept(self),
+   File "/types.py", line 1170, in accept
+     return visitor.visit_erased_type(self)
+   File "/expandtype.py", line 156, in visit_erased_type
+     raise RuntimeError()
+ RuntimeError: 

pylint (https://github.com/pycqa/pylint)
+ pylint/checkers/similar.py:352: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:354: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:355: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:356: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:357: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:358: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:381: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:382: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:383: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:384: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:393: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:480: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:483: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:508: error: Cannot determine type of "namespace"  [has-type]
+ pylint/checkers/similar.py:532: error: Cannot determine type of "namespace"  [has-type]

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/dependencies/data.py:89: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/dependencies/data.py:89: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/dependencies/data.py:95: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/dependencies/data.py:95: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:228: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:228: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:310: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:310: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:927: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:927: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:931: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:931: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:935: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:935: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:1346: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:1346: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:1688: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:1688: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:1785: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:1785: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2050: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2050: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2054: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2054: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2123: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2123: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2174: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2174: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2222: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2222: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2270: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2270: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2403: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2403: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2407: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2407: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2411: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2411: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2421: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2421: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2436: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2436: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2451: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2451: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2471: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2471: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2599: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2599: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2654: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2654: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2669: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2669: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2775: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2775: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2790: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2790: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2831: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2831: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2835: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2835: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2839: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2839: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2921: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2921: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2936: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2936: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2957: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2957: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2997: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2997: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3012: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3012: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3146: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3146: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3163: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3163: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3178: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3178: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3222: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3222: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3237: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3237: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3288: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3288: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3303: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3303: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3354: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3354: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3371: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3371: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3420: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3420: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3424: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3424: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4069: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4069: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4086: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4086: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4116: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4116: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4139: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4139: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases

... (truncated 2437 lines) ...

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2022

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

aiortc (https://github.com/aiortc/aiortc)
- src/aiortc/rtcrtpreceiver.py:498: error: Invalid index type "Union[int, str, None]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]
+ src/aiortc/rtcrtpreceiver.py:498: error: Invalid index type "Union[int, str]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]
- src/aiortc/rtcpeerconnection.py:92: error: Invalid index type "Union[int, str, None]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]
+ src/aiortc/rtcpeerconnection.py:92: error: Invalid index type "Union[int, str]" for "Dict[int, RTCRtpCodecParameters]"; expected type "int"  [index]

pyinstrument (https://github.com/joerick/pyinstrument)
- pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[Self, Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]
- pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[Self, Callable[..., Iterator[_T_co]], Tuple[Any, ...], Dict[str, Any]], None]")  [assignment]

operator (https://github.com/canonical/operator)
- ops/framework.py:445: error: Argument 1 to "_track" of "Framework" has incompatible type "Object"; expected "_Serializable"  [arg-type]
+ ops/framework.py:445: error: Argument 1 to "_track" of "Framework" has incompatible type "Self"; expected "_Serializable"  [arg-type]
- ops/framework.py:445: note: "Object" is missing following "_Serializable" protocol members:
- ops/framework.py:445: note:     restore, snapshot
- ops/framework.py:1069: error: Invalid signature "Callable[[BoundStoredState, Literal['on']], ObjectEvents]" for "__getattr__"  [misc]
+ ops/framework.py:1069: error: Invalid signature "Callable[[Self, Literal['on']], ObjectEvents]" for "__getattr__"  [misc]

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- pandas-stubs/core/strings.pyi:42: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [misc]
- pandas-stubs/_libs/tslibs/timestamps.pyi:188: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [misc]
- pandas-stubs/_libs/tslibs/timestamps.pyi:188: error: Overloaded function signatures 2 and 4 overlap with incompatible return types  [misc]
- pandas-stubs/_libs/tslibs/timestamps.pyi:207: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [misc]
- pandas-stubs/_libs/tslibs/timestamps.pyi:209: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [misc]
- pandas-stubs/_libs/tslibs/timestamps.pyi:209: error: Overloaded function signatures 2 and 4 overlap with incompatible return types  [misc]
+ tests/test_frame.py:253: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:253: error: No overload variant of "drop" of "DataFrame" matches argument type "List[str]"  [call-overload]
+ tests/test_frame.py:253: note: Possible overload variants:
+ tests/test_frame.py:253: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:253: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:253: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:254: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:254: error: No overload variant of "drop" of "DataFrame" matches argument type "List[int]"  [call-overload]
+ tests/test_frame.py:254: note: Possible overload variants:
+ tests/test_frame.py:254: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:254: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:254: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:255: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:255: error: No overload variant of "drop" of "DataFrame" matches argument type "List[int]"  [call-overload]
+ tests/test_frame.py:255: note: Possible overload variants:
+ tests/test_frame.py:255: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:255: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:255: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:256: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:256: error: No overload variant of "drop" of "DataFrame" matches argument type "List[str]"  [call-overload]
+ tests/test_frame.py:256: note: Possible overload variants:
+ tests/test_frame.py:256: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:256: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:256: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:259: error: Expression is of type "Any", not "None"  [assert-type]
+ tests/test_frame.py:259: error: No overload variant of "drop" of "DataFrame" matches argument types "List[int]", "bool"  [call-overload]
+ tests/test_frame.py:259: note: Possible overload variants:
+ tests/test_frame.py:259: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:259: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:259: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]
+ tests/test_frame.py:261: error: Expression is of type "Any", not "DataFrame"  [assert-type]
+ tests/test_frame.py:261: error: No overload variant of "drop" of "DataFrame" matches argument type "List[str]"  [call-overload]
+ tests/test_frame.py:261: note: Possible overload variants:
+ tests/test_frame.py:261: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[True], errors: Literal['ignore', 'raise'] = ...) -> None
+ tests/test_frame.py:261: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: Literal[False] = ..., errors: Literal['ignore', 'raise'] = ...) -> DataFrame
+ tests/test_frame.py:261: note:     def drop(self, labels: Union[Hashable, Index] = ..., *, axis: Union[str, int] = ..., index: Union[Hashable, Index] = ..., columns: Union[Hashable, Index] = ..., level: Hashable = ..., inplace: bool = ..., errors: Literal['ignore', 'raise'] = ...) -> Optional[DataFrame]

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/dependencies/data.py:89: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/dependencies/data.py:89: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/dependencies/data.py:95: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/dependencies/data.py:95: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:228: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:228: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:310: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:310: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:927: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:927: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:931: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:931: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:935: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:935: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:1346: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:1346: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:1688: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:1688: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:1785: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:1785: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2050: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2050: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2054: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2054: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2123: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2123: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2174: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2174: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2222: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2222: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2270: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2270: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2403: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2403: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2407: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2407: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2411: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2411: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2421: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2421: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2436: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2436: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2451: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2451: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2471: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2471: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2599: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2599: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2654: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2654: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2669: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2669: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2775: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2775: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2790: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2790: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2831: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2831: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2835: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2835: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2839: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2839: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2921: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2921: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2936: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2936: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2957: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2957: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:2997: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:2997: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3012: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3012: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3146: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3146: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3163: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3163: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3178: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3178: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3222: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3222: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3237: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3237: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3288: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3288: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3303: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3303: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3354: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3354: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3371: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3371: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3420: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3420: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:3424: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:3424: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4069: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4069: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4086: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4086: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4116: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4116: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4139: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4139: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4157: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4157: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4218: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4218: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4277: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4277: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4299: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4299: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4495: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4495: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4548: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4548: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4618: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4618: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4670: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4670: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4729: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4729: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4761: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4761: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4781: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4781: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/abc.py:4813: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/abc.py:4813: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:115: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:115: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:119: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:124: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:124: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:153: error: Returning Any from function declared to return Self?  [no-any-return]
- tanjun/hooks.py:160: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:160: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:165: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:165: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:187: error: Returning Any from function declared to return Self?  [no-any-return]
- tanjun/hooks.py:194: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:194: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:199: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:199: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:218: error: Returning Any from function declared to return Self?  [no-any-return]
- tanjun/hooks.py:225: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:225: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:230: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:230: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:249: error: Returning Any from function declared to return Self?  [no-any-return]
- tanjun/hooks.py:256: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:256: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:261: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/hooks.py:261: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/hooks.py:280: error: Returning Any from function declared to return Self?  [no-any-return]
- tanjun/dependencies/locales.py:114: error: Only concrete class can be given where "Type[AbstractLocaliser]" is expected  [type-abstract]
- tanjun/dependencies/locales.py:143: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/dependencies/locales.py:143: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/context/base.py:119: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/context/base.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/context/base.py:130: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/context/base.py:130: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ tanjun/components.py:109: error: Argument 1 has incompatible type "object"; expected "_CommandT"  [arg-type]
+ tanjun/components.py:111: error: Argument 1 to "collect_wrapped" has incompatible type "object"; expected "ExecutableCommand[Any]"  [arg-type]
- tanjun/components.py:323: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:323: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:340: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:340: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:344: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:344: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:352: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:352: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:422: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:422: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:448: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:448: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:468: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/components.py:468: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
- tanjun/components.py:489: error: Variable "typing_extensions.Self" is not valid as a type  [valid-type]
- tanjun/comp

... (truncated 2546 lines) ...

ilevkivskyi added a commit that referenced this pull request Nov 15, 2022
Ref #12840 
Fixes #11871
Fixes #14089

This is an alternative implementation to two existing PRs:
#11666,
#13133. This PR treats `typing.Self`
as pure syntactic sugar, and transforms it into a type variable early
during semantic analyzis.

This way we can re-use all the existing machinery and handled edge cases
for self-types. The only new thing is self-type for _attributes_ (as
proposed in the PEP). This required handling in several places, since
attribute access is duplicated in several places (see #7724), plus
special forms (like NamedTuples and TypedDicts) and dataclasses plugin
require additional care, since they use attribute annotations in special
ways.

I don't copy all the existing tests for "old style" self-types, but only
some common use cases, possible error conditions, and relevant new edge
cases, such as e.g. special forms mentioned above, and implicit type
variable binding for callable types.
@ilevkivskyi
Copy link
Member

Superseded by #14041

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.

3 participants