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

Show type aliases in error messages #12835

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

pranavrajpal
Copy link
Contributor

Description

This PR adds initial support for showing type aliases in error messages, which involves a few different parts:

  • adding the actual logic for printing type aliases (reusing the previous logic to show full names of aliases when necessary to avoid confusion)
  • fixing a few places where we expanded type aliases and then passed the expanded version to another function, instead of passing the unexpanded alias
  • making sure to expand aliases in errors about types becoming Any due to unfollowed imports if the type becoming Any was in the original aliased type
  • adding a few tests, and fixing some existing tests that had expanded aliases in error messages previously

As mentioned in #2968 (comment), there's still more work to do on showing type aliases in error messages, but I think this is a good start.

Works on #2968

Other notes about this PR:

  • Type arguments to generic aliases are printed in some errors, which might get confusing if it isn't obvious what order we're putting the type variables in when determining the list of type arguments.
  • I didn't add the expanded alias to the output like the issue suggested, since it seemed like it would require more changes to the error handling code and it would probably make errors involving large type aliases hard to understand. reveal_type still expands out aliases when printing, so I think this should be fine since the full type is fairly straightforward to access.
  • Looking at the test suite, errors tend to become slightly harder to understand for relatively simple aliases, since some useful information is less readily available in the error message when aliases aren't expanded. However, I suspect that the test suite is biased towards smaller type aliases, so this is probably less of a problem in real world code where there will most likely be larger type aliases (mypy_primer should help us see if this is true).

Test Plan

I added a few tests to the bottom of check-type-aliases.test, and I checked that the changes necessary for the other tests seemed to look reasonable.

Fairly simple change that doesn't completely work for showing type alias
names in error messages instead of showing the expanded alias.
As recommended in the docstring for get_proper_type, when you call
another function after expanding a type alias, pass the original
unexpanded type alias on instead of the expanded version.

This tries to fix a few places where we don't follow that in the error
formatting code so that unexpanded aliases make it to the error
formatting code.
Extend the logic for printing aliases to reuse the logic for printing
regular classes. That means that multiple aliases with the same name are
printed using their fullname, and generic aliases have their type
arguments printed.
If the underlying type that an alias refers to has part of it turned to
Any due to an unfollowed import, expand the alias before printing it in
the error to make it obvious where the Any actually shows up.

We avoid this in the case of the Any due to unfollowed import showing up
in the generic arguments, because then the error printing code will
clearly print the argument as Any.
Add test to make sure that, in errors about unfollowed imports turning
types into Any, we don't expand the alias if the only types turning into
Any are in the type arguments, instead of in the underlying type,
because then there will be an Any showing up when printing the
unexpanded alias.
Fix a lot of tests that had their error messages change due to us
printing the alias names instead of the expanded types.
Fix even more tests with aliases in the error messages.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Generally looks good, thanks! Just few comments below.

Btw I am not sure what do you mean by

Type arguments to generic aliases are printed in some errors, which might get confusing if it isn't obvious what order we're putting the type variables in when determining the list of type arguments.

I think the order should be always the correct one (there are unambiguous rules on this in PEP 484), and we should always print type arguments. Foo should be never printed instead of Foo[int], since Foo means Foo[Any].

@@ -1475,6 +1475,23 @@ def visit_callable_type(self, t: CallableType) -> TypeVarLikeList:
return []


def maybe_expand_unimported_type_becomes_any(
Copy link
Member

Choose a reason for hiding this comment

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

TBH this name is confusing, unimported_type_becomes_any_expanded would be better IMO. Also, I am not sure this is a best module for this helper. Shouldn't it be in messages.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My preferred approach would have been adding this code to unimported_type_becomes_any itself because, like you said, messages.py is a much better place for this than here and I can't really think of a reason you'd want to show that error without using the expanding logic here. The problem is that causes a crash due to an import cycle between typeanal.py and messages.py caused by the use of has_any_from_unimported_type.

Would it be better to move this into unimported_type_becomes_any anyway and just work around the crash?

[builtins fixtures/tuple.pyi]

# See https://github.com/python/mypy/issues/2968#issuecomment-1133768276
# We need to disable the no_args optimization to get this to work
Copy link
Member

Choose a reason for hiding this comment

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

This will have bad performance impact while we still have Text = str and similar "plain" aliases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's definitely a good point, but I'm not really sure I like the idea of mypy inconsistently showing alias names in error messages based on an implementation detail.

Either way, this PR doesn't actually change that behavior, and leaving the xfail test here seems like a good reminder that we need to discuss whether the performance benefits or consistency is more important (probably in the original issue).

mypy/messages.py Outdated
"""Return all instances that `t` contains (including `t`).
def collect_all_names(t: Type) -> List[Tuple[str, str]]:
"""Return all (shortname, fullname) pairs for all types that show
up when printing `t` in an error message.
Copy link
Member

Choose a reason for hiding this comment

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

This docstring is misleading. This function only collects "named" types, like instances and type aliases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the docstring. Could you take a look and see if it's clearer?

Eventually, we probably should update this to include the names of all types that show up when printing the type in an error message, but that seems like something for a different PR.

@AlexWaygood
Copy link
Member

AlexWaygood commented May 26, 2022

Would it be possible to show the full names of type aliases, instead of just the shortened names? E.g. show _typeshed.SupportsRichComparison instead of just SupportsRichComparison.

As a typeshed maintainer, I know where SupportsRichComparison is defined and what it means, but it would probably be really horrible to debug an error message with SupportsRichComparison in it if I were a typing newbie and didn't know anything about typeshed.

(I'm just using SupportsRichComparison as an example here, I think the point generally applies.)

Overall, I think this change is a massive usability win!

Make it clearer that collect_all_names only collects instances and type
aliases, not all types that show up in error messages.
@pranavrajpal
Copy link
Contributor Author

there are unambiguous rules on this in PEP 484

Could you clarify where those rules are in PEP 484? I can't find any mention of generic aliases in PEP 484, let alone the order of type arguments for generic aliases.

Would it be possible to show the full names of type aliases, instead of just the shortened names?

My main concern with doing that is that it could make some error messages harder to read by making them much longer. Looking at the mypy_primer output, there are a decent number of type aliases where it seems fairly easy to determine what they mean just by looking at the name, and using full names would make those messages much longer.

I'd agree that what you're saying is a problem though, so some other ideas are:

  • always show the full name for anything from _typeshed. We should probably do this anyway, even if it isn't a complete solution to this problem, since _typeshed types probably aren't as obviously tied to the functions they're being used in as something used in one module only.
  • always show the full name for anything defined in typeshed. This might not be helpful because just giving a full path to something in the standard library might point people towards the standard library itself, but it at least gives people something to pass in to reveal_type to understand what the expanded type alias is.
  • add a typeshed. prefix to anything from typeshed. This isn't a very principled approach but it makes people more likely to look up typeshed and find the github repo.

We could also try extending some of those options to types defined in any other libraries, but finding the source code and types for a third-party library is easier than finding the types for the standard library due to the special setup, so that seems less urgent.

@AlexWaygood
Copy link
Member

My main concern with doing that is that it could make some error messages harder to read by making them much longer.

Fair point — it does also feel in keeping with mypy's policy in other areas, though. I'm always amused by its steadfast commitment to calling str and int "builtins.str" and "builtins.int" in the output of reveal_type 😄

always show the full name for anything from _typeshed. We should probably do this anyway, even if it isn't a complete solution to this problem, since _typeshed types probably aren't as obviously tied to the functions they're being used in as something used in one module only.

Agree that this would be a great idea to do anyway. The slight complicating factor is that we may soon be moving some of these types from _typeshed to typing_extensions (python/typing_extensions#45). But we're not planning on deleting _typeshed any time soon; if we do move some across, it will only be our most stable types.

always show the full name for anything defined in typeshed.

If we don't want to always show the full name in type aliases, then this would be my second preference :)

@github-actions
Copy link
Contributor

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

paasta (https://github.com/yelp/paasta)
- paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[_SlaveT], Union[SupportsDunderLT, SupportsDunderGT]]"
- paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[Any], Union[SupportsDunderLT, SupportsDunderGT]]"
+ paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "_GenericNodeGroupingFunctionT[Any]"; expected "Callable[[_SlaveT], SupportsRichComparison]"
+ paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "_GenericNodeGroupingFunctionT[Any]"; expected "Callable[[Any], SupportsRichComparison]"

rclip (https://github.com/yurijmikhalevich/rclip)
- rclip/utils.py:45: error: Argument 1 to "makedirs" has incompatible type "Optional[str]"; expected "Union[str, bytes, PathLike[str], PathLike[bytes]]"
+ rclip/utils.py:45: error: Argument 1 to "makedirs" has incompatible type "Optional[str]"; expected "StrOrBytesPath"

aioredis (https://github.com/aio-libs/aioredis)
- aioredis/client.py:4114: error: Incompatible types in assignment (expression has type "Dict[Union[bytes, str], Optional[Any]]", variable has type "Dict[Union[bytes, str, memoryview], Callable[[Dict[str, str]], Awaitable[None]]]")  [assignment]
+ aioredis/client.py:4114: error: Incompatible types in assignment (expression has type "Dict[Union[bytes, str], Optional[Any]]", variable has type "Dict[ChannelT, PubSubHandler]")  [assignment]
- aioredis/client.py:4172: error: Incompatible types in assignment (expression has type "Dict[Union[bytes, str, memoryview], Callable[[Dict[str, str]], Awaitable[None]]]", variable has type "Dict[Any, Optional[Any]]")  [assignment]
+ aioredis/client.py:4172: error: Incompatible types in assignment (expression has type "Dict[ChannelT, PubSubHandler]", variable has type "Dict[Any, Optional[Any]]")  [assignment]

vision (https://github.com/pytorch/vision)
- torchvision/datasets/utils.py:70: error: Argument 1 to "md5" has incompatible type "**Dict[str, bool]"; expected "Union[bytes, Union[bytearray, memoryview, array[Any], mmap, _CData, PickleBuffer]]"  [arg-type]
+ torchvision/datasets/utils.py:70: error: Argument 1 to "md5" has incompatible type "**Dict[str, bool]"; expected "ReadableBuffer"  [arg-type]

pip (https://github.com/pypa/pip)
- src/pip/_internal/network/session.py:406: error: Argument 1 to "ip_address" has incompatible type "Optional[str]"; expected "Union[int, str, bytes, IPv4Address, IPv6Address]"
+ src/pip/_internal/network/session.py:406: error: Argument 1 to "ip_address" has incompatible type "Optional[str]"; expected "_RawIPAddress"

cwltool (https://github.com/common-workflow-language/cwltool)
- cwltool/pack.py:323:5: error: Returning Any from function declared to return "MutableMapping[str, Union[bool, str, int, float, MutableSequence[Union[None, bool, str, int, float, MutableSequence[Union[None, bool, str, int, float, MutableSequence[Any], MutableMapping[str, Any]]], MutableMapping[str, Union[None, bool, str, int, float, MutableSequence[Any], MutableMapping[str, Any]]]]], MutableMapping[str, Union[None, bool, str, int, float, MutableSequence[Union[None, bool, str, int, float, MutableSequence[Any], MutableMapping[str, Any]]], MutableMapping[str, Union[None, bool, str, int, float, MutableSequence[Any], MutableMapping[str, Any]]]]], None]]"  [no-any-return]
+ cwltool/pack.py:323:5: error: Returning Any from function declared to return "MutableMapping[str, Union[bool, str, int, float, MutableSequence[CWLOutputAtomType], MutableMapping[str, CWLOutputAtomType], None]]"  [no-any-return]
- cwltool/main.py:337:5: error: Returning Any from function declared to return "MutableMapping[str, Union[bool, str, int, float, MutableSequence[Union[None, bool, str, int, float, MutableSequence[Union[None, bool, str, int, float, MutableSequence[Any], MutableMapping[str, Any]]], MutableMapping[str, Union[None, bool, str, int, float, MutableSequence[Any], MutableMapping[str, Any]]]]], MutableMapping[str, Union[None, bool, str, int, float, MutableSequence[Union[None, bool, str, int, float, MutableSequence[Any], MutableMapping[str, Any]]], MutableMapping[str, Union[None, bool, str, int, float, MutableSequence[Any], MutableMapping[str, Any]]]]], None]]"  [no-any-return]
+ cwltool/main.py:337:5: error: Returning Any from function declared to return "MutableMapping[str, Union[bool, str, int, float, MutableSequence[CWLOutputAtomType], MutableMapping[str, CWLOutputAtomType], None]]"  [no-any-return]

steam.py (https://github.com/Gobot1234/steam.py)
- steam/image.py:88: error: Argument 1 to "open" has incompatible type "Union[ImageIO, str, bytes, PathLike[str], PathLike[bytes], int]"; expected "Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int]"  [arg-type]
+ steam/image.py:88: error: Argument 1 to "open" has incompatible type "Union[ImageIO, str, bytes, PathLike[str], PathLike[bytes], int]"; expected "_OpenFile"  [arg-type]

core (https://github.com/home-assistant/core)
- homeassistant/components/simplisafe/__init__.py:256: error: Redundant cast to "Union[Any, Any]"  [redundant-cast]
+ homeassistant/components/simplisafe/__init__.py:256: error: Redundant cast to "SystemType"  [redundant-cast]
- homeassistant/components/ridwell/sensor.py:93: error: Returning Any from function declared to return "Union[Union[None, str, int, float], date, datetime]"  [no-any-return]
+ homeassistant/components/ridwell/sensor.py:93: error: Returning Any from function declared to return "Union[StateType, date, datetime]"  [no-any-return]

dragonchain (https://github.com/dragonchain/dragonchain)
- dragonchain/lib/database/redis.py:399:36: error: Argument 2 to "zadd" of "SortedSetCommands" has incompatible type "Dict[str, int]"; expected "Mapping[Union[str, bytes], Union[bytes, float, int, str]]"
+ dragonchain/lib/database/redis.py:399:36: error: Argument 2 to "zadd" of "SortedSetCommands" has incompatible type "Dict[str, int]"; expected "Mapping[_Key, _Value]"
- dragonchain/lib/database/redis_utest.py:102:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str], Union[None, int, timedelta], Union[None, int, timedelta], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:102:9: error: "Callable[[_Key, _Value, Union[None, int, timedelta], Union[None, int, timedelta], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:106:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str], Union[None, int, timedelta], Union[None, int, timedelta], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:106:9: error: "Callable[[_Key, _Value, Union[None, int, timedelta], Union[None, int, timedelta], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:110:9: error: "Callable[[Union[str, bytes]], Optional[Any]]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:110:9: error: "Callable[[_Key], Optional[Any]]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:114:9: error: "Callable[[VarArg(Union[str, bytes])], int]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:114:9: error: "Callable[[VarArg(_Key)], int]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:122:9: error: "Callable[[bool, KwArg(Union[Any, Any])], bool]" has no attribute "assert_called_once"
+ dragonchain/lib/database/redis_utest.py:122:9: error: "Callable[[bool, KwArg(_CommandOptions)], bool]" has no attribute "assert_called_once"
- dragonchain/lib/database/redis_utest.py:126:9: error: "Callable[[Union[str, bytes], VarArg(Union[str, bytes])], int]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:126:9: error: "Callable[[_Key, VarArg(_Key)], int]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:130:9: error: "Callable[[Union[bytes, float, int, str], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:130:9: error: "Callable[[_Value, VarArg(_Value)], int]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:134:9: error: "Callable[[Union[bytes, float, int, str], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:134:9: error: "Callable[[_Value, VarArg(_Value)], int]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:138:9: error: "Callable[[VarArg(Union[str, bytes])], int]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:138:9: error: "Callable[[VarArg(_Key)], int]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:154:9: error: "Callable[[Union[str, bytes]], Optional[Any]]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:154:9: error: "Callable[[_Key], Optional[Any]]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:158:9: error: "Callable[[Union[str, bytes], int], Optional[Any]]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:158:9: error: "Callable[[_Key, int], Optional[Any]]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:162:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str], Union[None, int, timedelta], Union[None, int, timedelta], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:162:9: error: "Callable[[_Key, _Value, Union[None, int, timedelta], Union[None, int, timedelta], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:166:9: error: "Callable[[Union[str, bytes], int, int], bool]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:166:9: error: "Callable[[_Key, int, int], bool]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:170:9: error: "Callable[[Union[str, bytes], Union[str, bytes]], Optional[Any]]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:170:9: error: "Callable[[_Key, _Key], Optional[Any]]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:174:9: error: "Callable[[Union[str, bytes], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:174:9: error: "Callable[[_Key, VarArg(_Value)], int]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:178:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str]], bool]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:178:9: error: "Callable[[_Key, _Value], bool]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:182:9: error: "Callable[[Union[str, bytes]], Set[Any]]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:182:9: error: "Callable[[_Key], Set[Any]]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:186:9: error: "Callable[[Union[str, bytes], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:186:9: error: "Callable[[_Key, VarArg(_Value)], int]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:190:9: error: "Callable[[Union[str, bytes], int, int], List[Any]]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:190:9: error: "Callable[[_Key, int, int], List[Any]]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:198:9: error: "Callable[[Union[str, bytes]], int]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:198:9: error: "Callable[[_Key], int]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:210:9: error: "Callable[[Union[str, bytes]], Dict[Any, Any]]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:210:9: error: "Callable[[_Key], Dict[Any, Any]]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:214:9: error: "Callable[[Union[str, bytes], Union[str, bytes]], bool]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:214:9: error: "Callable[[_Key, _Key], bool]" has no attribute "assert_called_once_with"
- dragonchain/lib/database/redis_utest.py:218:9: error: "Callable[[Union[str, bytes], Mapping[Union[str, bytes], Union[bytes, float, int, str]], bool, bool, bool, bool, Optional[Any], Optional[Any]], int]" has no attribute "assert_called_once_with"
+ dragonchain/lib/database/redis_utest.py:218:9: error: "Callable[[_Key, Mapping[_Key, _Value], bool, bool, bool, bool, Optional[Any], Optional[Any]], int]" has no attribute "assert_called_once_with"

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/context/slash.py:853: note:          def respond(self, content: Union[Any, UndefinedType] = ..., *, ensure_result: Literal[True], delete_after: Union[timedelta, float, int, None] = ..., component: Union[ComponentBuilder, UndefinedType] = ..., components: Union[Sequence[ComponentBuilder], UndefinedType] = ..., embed: Union[Embed, UndefinedType] = ..., embeds: Union[Sequence[Embed], UndefinedType] = ..., mentions_everyone: Union[bool, UndefinedType] = ..., user_mentions: Union[Sequence[Union[PartialUser, Union[Snowflake, int]]], bool, UndefinedType] = ..., role_mentions: Union[Sequence[Union[PartialRole, Union[Snowflake, int]]], bool, UndefinedType] = ...) -> Coroutine[Any, Any, Message]
+ tanjun/context/slash.py:853: note:          def respond(self, content: UndefinedOr[Any] = ..., *, ensure_result: Literal[True], delete_after: Union[timedelta, float, int, None] = ..., component: UndefinedOr[ComponentBuilder] = ..., components: UndefinedOr[Sequence[ComponentBuilder]] = ..., embed: UndefinedOr[Embed] = ..., embeds: UndefinedOr[Sequence[Embed]] = ..., mentions_everyone: UndefinedOr[bool] = ..., user_mentions: Union[SnowflakeishSequence[PartialUser], bool, UndefinedType] = ..., role_mentions: Union[SnowflakeishSequence[PartialRole], bool, UndefinedType] = ...) -> Coroutine[Any, Any, Message]
- tanjun/context/slash.py:853: note:          def respond(self, content: Union[Any, UndefinedType] = ..., *, ensure_result: bool = ..., delete_after: Union[timedelta, float, int, None] = ..., component: Union[ComponentBuilder, UndefinedType] = ..., components: Union[Sequence[ComponentBuilder], UndefinedType] = ..., embed: Union[Embed, UndefinedType] = ..., embeds: Union[Sequence[Embed], UndefinedType] = ..., mentions_everyone: Union[bool, UndefinedType] = ..., user_mentions: Union[Sequence[Union[PartialUser, Union[Snowflake, int]]], bool, UndefinedType] = ..., role_mentions: Union[Sequence[Union[PartialRole, Union[Snowflake, int]]], bool, UndefinedType] = ...) -> Coroutine[Any, Any, Optional[Message]]
+ tanjun/context/slash.py:853: note:          def respond(self, content: UndefinedOr[Any] = ..., *, ensure_result: bool = ..., delete_after: Union[timedelta, float, int, None] = ..., component: UndefinedOr[ComponentBuilder] = ..., components: UndefinedOr[Sequence[ComponentBuilder]] = ..., embed: UndefinedOr[Embed] = ..., embeds: UndefinedOr[Sequence[Embed]] = ..., mentions_everyone: UndefinedOr[bool] = ..., user_mentions: Union[SnowflakeishSequence[PartialUser], bool, UndefinedType] = ..., role_mentions: Union[SnowflakeishSequence[PartialRole], bool, UndefinedType] = ...) -> Coroutine[Any, Any, Optional[Message]]
- tanjun/context/slash.py:853: note:          def respond(self, content: Union[Any, UndefinedType] = ..., *, ensure_result: Literal[False] = ..., delete_after: Union[timedelta, float, int, None] = ..., component: Union[ComponentBuilder, UndefinedType] = ..., components: Union[Sequence[ComponentBuilder], UndefinedType] = ..., embed: Union[Embed, UndefinedType] = ..., embeds: Union[Sequence[Embed], UndefinedType] = ..., mentions_everyone: Union[bool, UndefinedType] = ..., user_mentions: Union[Sequence[Union[PartialUser, Union[Snowflake, int]]], bool, UndefinedType] = ..., role_mentions: Union[Sequence[Union[PartialRole, Union[Snowflake, int]]], bool, UndefinedType] = ...) -> Coroutine[Any, Any, Optional[Message]]
+ tanjun/context/slash.py:853: note:          def respond(self, content: UndefinedOr[Any] = ..., *, ensure_result: Literal[False] = ..., delete_after: Union[timedelta, float, int, None] = ..., component: UndefinedOr[ComponentBuilder] = ..., components: UndefinedOr[Sequence[ComponentBuilder]] = ..., embed: UndefinedOr[Embed] = ..., embeds: UndefinedOr[Sequence[Embed]] = ..., mentions_everyone: UndefinedOr[bool] = ..., user_mentions: Union[SnowflakeishSequence[PartialUser], bool, UndefinedType] = ..., role_mentions: Union[SnowflakeishSequence[PartialRole], bool, UndefinedType] = ...) -> Coroutine[Any, Any, Optional[Message]]
- tanjun/context/slash.py:853: note:          def respond(self, content: Union[Any, UndefinedType] = ..., *, ensure_result: Literal[True], delete_after: Union[timedelta, float, int, None] = ..., component: Union[ComponentBuilder, UndefinedType] = ..., components: Union[Sequence[ComponentBuilder], UndefinedType] = ..., embed: Union[Embed, UndefinedType] = ..., embeds: Union[Sequence[Embed], UndefinedType] = ..., mentions_everyone: Union[bool, UndefinedType] = ..., user_mentions: Union[Sequence[Union[PartialUser, Union[Snowflake, int]]], bool, UndefinedType] = ..., role_mentions: Union[Sequence[Union[PartialRole, Union[Snowflake, int]]], bool, UndefinedType] = ...) -> Coroutine[Any, Any, Message]
+ tanjun/context/slash.py:853: note:          def respond(self, content: UndefinedOr[Any] = ..., *, ensure_result: Literal[True], delete_after: Union[timedelta, float, int, None] = ..., component: UndefinedOr[ComponentBuilder] = ..., components: UndefinedOr[Sequence[ComponentBuilder]] = ..., embed: UndefinedOr[Embed] = ..., embeds: UndefinedOr[Sequence[Embed]] = ..., mentions_everyone: UndefinedOr[bool] = ..., user_mentions: Union[SnowflakeishSequence[PartialUser], bool, UndefinedType] = ..., role_mentions: Union[SnowflakeishSequence[PartialRole], bool, UndefinedType] = ...) -> Coroutine[Any, Any, Message]

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.

None yet

3 participants