Skip to content

Commit

Permalink
Fix typehints for __class_getitem__ in Transform and Range
Browse files Browse the repository at this point in the history
  • Loading branch information
owocado committed Sep 30, 2023
1 parent c115cfb commit cf79af2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/app_commands/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ class Transform:
.. versionadded:: 2.0
"""

def __class_getitem__(cls, items) -> _TransformMetadata:
def __class_getitem__(cls, items) -> Transformer:
if not isinstance(items, tuple):
raise TypeError(f'expected tuple for arguments, received {items.__class__.__name__} instead')

Expand Down Expand Up @@ -570,7 +570,7 @@ async def range(interaction: discord.Interaction, value: app_commands.Range[int,
await interaction.response.send_message(f'Your value is {value}', ephemeral=True)
"""

def __class_getitem__(cls, obj) -> _TransformMetadata:
def __class_getitem__(cls, obj) -> RangeTransformer:
if not isinstance(obj, tuple):
raise TypeError(f'expected tuple for arguments, received {obj.__class__.__name__} instead')

Expand Down

0 comments on commit cf79af2

Please sign in to comment.