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

Represent bottom type as Never #15996

Merged
merged 1 commit into from
Aug 31, 2023
Merged

Conversation

hauntsaninja
Copy link
Collaborator

Fixes #15950

@github-actions
Copy link
Contributor

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

comtypes (https://github.com/enthought/comtypes)
- comtypes/typeinfo.py:451: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[<nothing>]"  [arg-type]
+ comtypes/typeinfo.py:451: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]"  [arg-type]
- comtypes/typeinfo.py:706: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[<nothing>]"  [arg-type]
+ comtypes/typeinfo.py:706: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]"  [arg-type]
- comtypes/typeinfo.py:849: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[<nothing>]"  [arg-type]
+ comtypes/typeinfo.py:849: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]"  [arg-type]
- comtypes/errorinfo.py:18: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[<nothing>]"  [arg-type]
+ comtypes/errorinfo.py:18: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]"  [arg-type]
- comtypes/errorinfo.py:33: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[<nothing>]"  [arg-type]
+ comtypes/errorinfo.py:33: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]"  [arg-type]
- comtypes/errorinfo.py:48: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[<nothing>]"  [arg-type]
+ comtypes/errorinfo.py:48: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]"  [arg-type]

paasta (https://github.com/yelp/paasta)
- paasta_tools/instance/kubernetes.py:1127: error: Argument 1 to "create_task" has incompatible type "Awaitable[Sequence[Any]]"; expected "Union[Generator[Any, None, <nothing>], Coroutine[Any, Any, <nothing>]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:1127: error: Argument 1 to "create_task" has incompatible type "Awaitable[Sequence[Any]]"; expected "Union[Generator[Any, None, Never], Coroutine[Any, Any, Never]]"  [arg-type]
- paasta_tools/instance/kubernetes.py:1319: error: Argument 1 to "create_task" has incompatible type "Awaitable[Sequence[Any]]"; expected "Union[Generator[Any, None, <nothing>], Coroutine[Any, Any, <nothing>]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:1319: error: Argument 1 to "create_task" has incompatible type "Awaitable[Sequence[Any]]"; expected "Union[Generator[Any, None, Never], Coroutine[Any, Any, Never]]"  [arg-type]

steam.py (https://github.com/Gobot1234/steam.py)
- steam/ext/csgo/state.py:86: error: Incompatible types in assignment (expression has type "Future[<nothing>]", target has type "Future[CasketItem]")  [assignment]
+ steam/ext/csgo/state.py:86: error: Incompatible types in assignment (expression has type "Future[Never]", target has type "Future[CasketItem]")  [assignment]

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/utilities/annotations.py:48: note:          def __getitem__(self, SupportsIndex, /) -> <nothing>
+ src/prefect/utilities/annotations.py:48: note:          def __getitem__(self, SupportsIndex, /) -> Never
- src/prefect/utilities/annotations.py:48: note:          def __getitem__(self, slice, /) -> tuple[<nothing>, ...]
+ src/prefect/utilities/annotations.py:48: note:          def __getitem__(self, slice, /) -> tuple[Never, ...]
- src/prefect/utilities/annotations.py:48: note:          def __getitem__(self, int, /) -> <nothing>
+ src/prefect/utilities/annotations.py:48: note:          def __getitem__(self, int, /) -> Never
- src/prefect/utilities/annotations.py:48: note:          def __getitem__(self, slice, /) -> Sequence[<nothing>]
+ src/prefect/utilities/annotations.py:48: note:          def __getitem__(self, slice, /) -> Sequence[Never]
- src/prefect/utilities/asyncutils.py:259: error: Argument 1 to "is_async_fn" has incompatible type "T"; expected "Callable[[VarArg(<nothing>), KwArg(<nothing>)], <nothing>] | Callable[[VarArg(<nothing>), KwArg(<nothing>)], Awaitable[<nothing>]]"  [arg-type]
+ src/prefect/utilities/asyncutils.py:259: error: Argument 1 to "is_async_fn" has incompatible type "T"; expected "Callable[[VarArg(Never), KwArg(Never)], Never] | Callable[[VarArg(Never), KwArg(Never)], Awaitable[Never]]"  [arg-type]
- src/prefect/settings.py:524: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:524: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:730: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:730: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:737: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:737: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:852: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:852: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:988: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:988: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:997: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:997: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1296: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1296: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1308: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1308: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1320: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1320: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1332: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1332: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1345: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1345: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1358: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1358: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1370: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1370: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1397: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1397: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1409: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1409: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1421: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1421: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1433: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1433: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1445: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1445: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1457: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1457: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1471: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1471: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1483: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1483: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1495: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1495: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1507: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1507: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1519: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1519: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1531: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1531: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1543: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1543: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1555: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1555: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1569: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1569: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1583: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1583: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1595: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1595: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1607: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1607: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1619: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]
+ src/prefect/settings.py:1619: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[Never]"  [arg-type]
- src/prefect/settings.py:1631: error: Argument 1 to "Setting" has incompatible type "object"; expected "type[<nothing>]"  [arg-type]

... (truncated 23 lines) ...

sublime_debugger (https://github.com/daveleroy/sublime_debugger)
- modules/command.py:73: error: <nothing> not callable  [misc]
+ modules/command.py:73: error: Never not callable  [misc]

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/dependencies/data.py:219: error: Argument "callback" to "inject" has incompatible type "Callable[..., Coroutine[Any, Any, _T]]"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/dependencies/data.py:219: error: Argument "callback" to "inject" has incompatible type "Callable[..., Coroutine[Any, Any, _T]]"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/dependencies/data.py:351: error: Argument "callback" to "inject" has incompatible type "Callable[..., Coroutine[Any, Any, _T]]"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/dependencies/data.py:351: error: Argument "callback" to "inject" has incompatible type "Callable[..., Coroutine[Any, Any, _T]]"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/dependencies/reloaders.py:513: error: Incompatible return value type (got "tuple[Path, Union[tuple[None, set[<nothing>]], tuple[str, set[<nothing>]]]]", expected "tuple[Path, Union[tuple[str, set[str]], tuple[None, set[Path]]]]")  [return-value]
+ tanjun/dependencies/reloaders.py:513: error: Incompatible return value type (got "tuple[Path, Union[tuple[None, set[Never]], tuple[str, set[Never]]]]", expected "tuple[Path, Union[tuple[str, set[str]], tuple[None, set[Path]]]]")  [return-value]
- tanjun/schedules.py:338: error: Argument 1 to "call_with_async_di" of "Client" has incompatible type "_CallbackSigT"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/schedules.py:338: error: Argument 1 to "call_with_async_di" of "Client" has incompatible type "_CallbackSigT"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/schedules.py:364: error: Argument 1 to "call_with_async_di" of "Client" has incompatible type "Callable[..., Coroutine[Any, Any, None]]"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/schedules.py:364: error: Argument 1 to "call_with_async_di" of "Client" has incompatible type "Callable[..., Coroutine[Any, Any, None]]"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/schedules.py:387: error: Argument 1 to "call_with_async_di" of "Client" has incompatible type "Callable[..., Coroutine[Any, Any, None]]"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/schedules.py:387: error: Argument 1 to "call_with_async_di" of "Client" has incompatible type "Callable[..., Coroutine[Any, Any, None]]"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/schedules.py:1050: error: Argument 1 to "call_with_async_di" of "Client" has incompatible type "_CallbackSigT"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/schedules.py:1050: error: Argument 1 to "call_with_async_di" of "Client" has incompatible type "_CallbackSigT"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/parsing.py:609: error: <nothing> has no attribute "__iter__" (not iterable)  [attr-defined]
+ tanjun/parsing.py:609: error: Never has no attribute "__iter__" (not iterable)  [attr-defined]
- tanjun/dependencies/limiters.py:851: error: <nothing> has no attribute "unlock"  [attr-defined]
+ tanjun/dependencies/limiters.py:851: error: Never has no attribute "unlock"  [attr-defined]
- tanjun/commands/slash.py:3179: error: Argument 1 to "call_with_async_di" of "Context" has incompatible type "_SlashCallbackSigT"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/commands/slash.py:3179: error: Argument 1 to "call_with_async_di" of "Context" has incompatible type "_SlashCallbackSigT"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/commands/slash.py:3222: error: Argument 1 to "call_with_async_di" of "Context" has incompatible type "Callable[[AutocompleteContext, str, VarArg(Any), KwArg(Any)], Coroutine[Any, Any, None]]"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/commands/slash.py:3222: error: Argument 1 to "call_with_async_di" of "Context" has incompatible type "Callable[[AutocompleteContext, str, VarArg(Any), KwArg(Any)], Coroutine[Any, Any, None]]"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/commands/message.py:349: error: Argument 1 to "call_with_async_di" of "Context" has incompatible type "_MessageCallbackSigT"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/commands/message.py:349: error: Argument 1 to "call_with_async_di" of "Context" has incompatible type "_MessageCallbackSigT"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/commands/menu.py:690: error: Argument 1 to "call_with_async_di" of "Context" has incompatible type "_AnyMenuCallbackSigT"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/commands/menu.py:690: error: Argument 1 to "call_with_async_di" of "Context" has incompatible type "_AnyMenuCallbackSigT"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/clients.py:2309: error: <nothing> has no attribute "__iter__" (not iterable)  [attr-defined]
+ tanjun/clients.py:2309: error: Never has no attribute "__iter__" (not iterable)  [attr-defined]
- tanjun/clients.py:2309: error: Argument 1 to "call_with_async_di" of "Context" has incompatible type "Callable[[MessageContext, VarArg(Any), KwArg(Any)], Coroutine[Any, Any, Iterable[str]]]"; expected "Callable[..., Union[Coroutine[Any, Any, <nothing>], <nothing>]]"  [arg-type]
+ tanjun/clients.py:2309: error: Argument 1 to "call_with_async_di" of "Context" has incompatible type "Callable[[MessageContext, VarArg(Any), KwArg(Any)], Coroutine[Any, Any, Iterable[str]]]"; expected "Callable[..., Union[Coroutine[Any, Any, Never], Never]]"  [arg-type]
- tanjun/annotations.py:1072: error: Argument 1 to "new" of "_Field" has incompatible type "<typing special form>"; expected "type[<nothing>]"  [arg-type]
+ tanjun/annotations.py:1072: error: Argument 1 to "new" of "_Field" has incompatible type "<typing special form>"; expected "type[Never]"  [arg-type]

discord.py (https://github.com/Rapptz/discord.py)
- discord/state.py:255: error: Incompatible types in assignment (expression has type "dict[<nothing>, <nothing>]", variable has type "dict[str, Callable[[Any], None]]")  [assignment]
+ discord/state.py:255: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "dict[str, Callable[[Any], None]]")  [assignment]
- discord/message.py:1841: error: Incompatible types in assignment (expression has type "list[<nothing>]", variable has type "list[User | Member]")  [assignment]
+ discord/message.py:1841: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "list[User | Member]")  [assignment]
- discord/abc.py:511: error: Argument 1 to "enumerate" has incompatible type "object"; expected "Iterable[<nothing>]"  [arg-type]
+ discord/abc.py:511: error: Argument 1 to "enumerate" has incompatible type "object"; expected "Iterable[Never]"  [arg-type]
- discord/app_commands/tree.py:648: error: Incompatible return value type (got "list[<nothing>]", expected "list[ContextMenu] | list[Command[Any, [VarArg(Any), KwArg(Any)], Any] | Group] | list[Command[Any, [VarArg(Any), KwArg(Any)], Any] | Group | ContextMenu]")  [return-value]
+ discord/app_commands/tree.py:648: error: Incompatible return value type (got "list[Never]", expected "list[ContextMenu] | list[Command[Any, [VarArg(Any), KwArg(Any)], Any] | Group] | list[Command[Any, [VarArg(Any), KwArg(Any)], Any] | Group | ContextMenu]")  [return-value]
- discord/app_commands/commands.py:973: error: Argument 1 to "maybe_coroutine" has incompatible type "Callable[[Interaction[Any]], Coroutine[Any, Any, bool]]"; expected "Callable[[Interaction[Any]], <nothing> | Awaitable[<nothing>]]"  [arg-type]
+ discord/app_commands/commands.py:973: error: Argument 1 to "maybe_coroutine" has incompatible type "Callable[[Interaction[Any]], Coroutine[Any, Any, bool]]"; expected "Callable[[Interaction[Any]], Never | Awaitable[Never]]"  [arg-type]
- discord/ext/commands/flags.py:629: error: Incompatible types in assignment (expression has type "dict[<nothing>, <nothing>]", variable has type "list[str]")  [assignment]
+ discord/ext/commands/flags.py:629: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]")  [assignment]
- discord/ext/commands/flags.py:629: error: Argument 1 to "dict" has incompatible type "list[str]"; expected "Iterable[tuple[<nothing>, <nothing>]]"  [arg-type]
+ discord/ext/commands/flags.py:629: error: Argument 1 to "dict" has incompatible type "list[str]"; expected "Iterable[tuple[Never, Never]]"  [arg-type]
- discord/ext/commands/cog.py:700: error: Argument 1 to "maybe_coroutine" has incompatible type "Callable[[], Coroutine[Any, Any, None]]"; expected "Callable[[], <nothing> | Awaitable[<nothing>]]"  [arg-type]
+ discord/ext/commands/cog.py:700: error: Argument 1 to "maybe_coroutine" has incompatible type "Callable[[], Coroutine[Any, Any, None]]"; expected "Callable[[], Never | Awaitable[Never]]"  [arg-type]
- discord/ext/commands/cog.py:717: error: Argument 1 to "maybe_coroutine" has incompatible type "Callable[[], Coroutine[Any, Any, None]]"; expected "Callable[[], <nothing> | Awaitable[<nothing>]]"  [arg-type]
+ discord/ext/commands/cog.py:717: error: Argument 1 to "maybe_coroutine" has incompatible type "Callable[[], Coroutine[Any, Any, None]]"; expected "Callable[[], Never | Awaitable[Never]]"  [arg-type]
- discord/ext/commands/cog.py:770: error: Argument 1 to "maybe_coroutine" has incompatible type "Callable[[], Coroutine[Any, Any, None]]"; expected "Callable[[], <nothing> | Awaitable[<nothing>]]"  [arg-type]
+ discord/ext/commands/cog.py:770: error: Argument 1 to "maybe_coroutine" has incompatible type "Callable[[], Coroutine[Any, Any, None]]"; expected "Callable[[], Never | Awaitable[Never]]"  [arg-type]
- discord/ext/commands/core.py:639: error: Argument 1 has incompatible type "CogT"; expected <nothing>  [arg-type]
+ discord/ext/commands/core.py:639: error: Argument 1 has incompatible type "CogT"; expected Never  [arg-type]
- discord/ext/commands/core.py:639: error: Argument 2 has incompatible type "Context[BotT]"; expected <nothing>  [arg-type]
+ discord/ext/commands/core.py:639: error: Argument 2 has incompatible type "Context[BotT]"; expected Never  [arg-type]
- discord/ext/commands/core.py:639: error: Argument 3 has incompatible type "CommandError"; expected <nothing>  [arg-type]
+ discord/ext/commands/core.py:639: error: Argument 3 has incompatible type "CommandError"; expected Never  [arg-type]
- discord/ext/commands/hybrid.py:399: error: Argument 1 to "maybe_coroutine" has incompatible type "Callable[[Interaction[Any]], Coroutine[Any, Any, bool]]"; expected "Callable[[Interaction[Any]], <nothing> | Awaitable[<nothing>]]"  [arg-type]
+ discord/ext/commands/hybrid.py:399: error: Argument 1 to "maybe_coroutine" has incompatible type "Callable[[Interaction[Any]], Coroutine[Any, Any, bool]]"; expected "Callable[[Interaction[Any]], Never | Awaitable[Never]]"  [arg-type]

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/elements/selectbox_test.py:94:39: error: Argument 2 has incompatible type "int"; expected "Union[Iterable[<nothing>], DataFrameGenericAlias[<nothing>]]"  [arg-type]
+ lib/tests/streamlit/elements/selectbox_test.py:94:39: error: Argument 2 has incompatible type "int"; expected "Union[Iterable[Never], DataFrameGenericAlias[Never]]"  [arg-type]

ibis (https://github.com/ibis-project/ibis)
- ibis/expr/datatypes/core.py:206: error: Incompatible return value type (got "Array[<nothing>]", expected "Self")  [return-value]
+ ibis/expr/datatypes/core.py:206: error: Incompatible return value type (got "Array[Never]", expected "Self")  [return-value]
- ibis/expr/datatypes/core.py:209: error: Incompatible return value type (got "Map[Any, <nothing>]", expected "Self")  [return-value]
+ ibis/expr/datatypes/core.py:209: error: Incompatible return value type (got "Map[Any, Never]", expected "Self")  [return-value]
- ibis/expr/schema.py:119: error: Argument 1 to "Schema" has incompatible type "dict[<nothing>, <nothing>]"; expected "FrozenDict[str, DataType]"  [arg-type]
+ ibis/expr/schema.py:119: error: Argument 1 to "Schema" has incompatible type "dict[Never, Never]"; expected "FrozenDict[str, DataType]"  [arg-type]
- ibis/expr/operations/udf.py:136: error: Incompatible types in assignment (expression has type "FrozenDict[<nothing>, <nothing>]", target has type "Argument")  [assignment]
+ ibis/expr/operations/udf.py:136: error: Incompatible types in assignment (expression has type "FrozenDict[Never, Never]", target has type "Argument")  [assignment]
- ibis/expr/datatypes/tests/test_core.py:26: error: Argument 1 to "Array" has incompatible type "Array[<nothing>]"; expected "bool"  [arg-type]
+ ibis/expr/datatypes/tests/test_core.py:26: error: Argument 1 to "Array" has incompatible type "Array[Never]"; expected "bool"  [arg-type]
- ibis/expr/datatypes/tests/test_core.py:30: error: Argument 1 to "Array" has incompatible type "Map[Int8, <nothing>]"; expected "bool"  [arg-type]
+ ibis/expr/datatypes/tests/test_core.py:30: error: Argument 1 to "Array" has incompatible type "Map[Int8, Never]"; expected "bool"  [arg-type]
- ibis/common/egraph.py:723: error: Argument 1 to "promote_list" has incompatible type "list[Rewrite]"; expected "Sequence[<nothing>]"  [arg-type]
+ ibis/common/egraph.py:723: error: Argument 1 to "promote_list" has incompatible type "list[Rewrite]"; expected "Sequence[Never]"  [arg-type]
- ibis/backends/polars/tests/test_datatypes.py:40: error: Argument 1 to "Array" has incompatible type "Array[<nothing>]"; expected "bool"  [arg-type]
+ ibis/backends/polars/tests/test_datatypes.py:40: error: Argument 1 to "Array" has incompatible type "Array[Never]"; expected "bool"  [arg-type]
- ibis/backends/clickhouse/datatypes.py:80: error: Argument 1 to "Struct" has incompatible type "dict[Any, Array[<nothing>]]"; expected "bool"  [arg-type]
+ ibis/backends/clickhouse/datatypes.py:80: error: Argument 1 to "Struct" has incompatible type "dict[Any, Array[Never]]"; expected "bool"  [arg-type]
- ibis/backends/clickhouse/tests/test_types.py:130: error: Argument 1 to "Array" has incompatible type "Array[<nothing>]"; expected "bool"  [arg-type]
+ ibis/backends/clickhouse/tests/test_types.py:130: error: Argument 1 to "Array" has incompatible type "Array[Never]"; expected "bool"  [arg-type]
- ibis/backends/clickhouse/tests/test_types.py:138: error: Argument 1 to "Array" has incompatible type "Array[<nothing>]"; expected "bool"  [arg-type]
+ ibis/backends/clickhouse/tests/test_types.py:138: error: Argument 1 to "Array" has incompatible type "Array[Never]"; expected "bool"  [arg-type]
- ibis/backends/clickhouse/tests/test_types.py:139: error: Argument 1 to "Array" has incompatible type "Array[<nothing>]"; expected "bool"  [arg-type]
+ ibis/backends/clickhouse/tests/test_types.py:139: error: Argument 1 to "Array" has incompatible type "Array[Never]"; expected "bool"  [arg-type]
- ibis/backends/clickhouse/tests/test_types.py:149: error: Argument 1 to "Array" has incompatible type "Array[<nothing>]"; expected "bool"  [arg-type]
+ ibis/backends/clickhouse/tests/test_types.py:149: error: Argument 1 to "Array" has incompatible type "Array[Never]"; expected "bool"  [arg-type]
- ibis/backends/clickhouse/tests/test_types.py:150: error: Argument 1 to "Array" has incompatible type "Array[<nothing>]"; expected "bool"  [arg-type]
+ ibis/backends/clickhouse/tests/test_types.py:150: error: Argument 1 to "Array" has incompatible type "Array[Never]"; expected "bool"  [arg-type]
- ibis/backends/clickhouse/tests/test_types.py:151: error: Argument 1 to "Array" has incompatible type "Array[<nothing>]"; expected "bool"  [arg-type]
+ ibis/backends/clickhouse/tests/test_types.py:151: error: Argument 1 to "Array" has incompatible type "Array[Never]"; expected "bool"  [arg-type]
- ibis/backends/clickhouse/tests/test_types.py:202: error: Argument 1 to "Struct" has incompatible type "dict[str, Array[<nothing>]]"; expected "bool"  [arg-type]
+ ibis/backends/clickhouse/tests/test_types.py:202: error: Argument 1 to "Struct" has incompatible type "dict[str, Array[Never]]"; expected "bool"  [arg-type]
- ibis/backends/clickhouse/tests/test_types.py:204: error: Argument 1 to "Array" has incompatible type "Array[<nothing>]"; expected "bool"  [arg-type]

... (truncated 33 lines) ...```

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this is more consistent and should make it easier to find documentation.

@JukkaL JukkaL merged commit df4717e into python:master Aug 31, 2023
18 checks passed
@hauntsaninja hauntsaninja deleted the nothing-repr branch August 31, 2023 17:03
hauntsaninja added a commit to hauntsaninja/mypy that referenced this pull request May 31, 2024
Switches the logic from python#16994
to use ambiguous (since is_noreturn was only meant for error messages)

See also python#15996
hauntsaninja added a commit that referenced this pull request May 31, 2024
Switches the logic from #16994 to use
ambiguous (since is_noreturn was only meant for error messages)

See also #15996
GiorgosPapoutsakis pushed a commit to GiorgosPapoutsakis/mypy that referenced this pull request Jun 3, 2024
Switches the logic from python#16994 to use
ambiguous (since is_noreturn was only meant for error messages)

See also python#15996
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.

Change the string representation of the bottom type from <nothing> to typing.Never
2 participants