Skip to content

Commit

Permalink
fix(typing): yet another set of misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftinv committed Nov 15, 2023
1 parent bfcbf84 commit fbc4f8d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions disnake/ext/commands/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ def __class_getitem__(cls, params: Union[Tuple[T], T]) -> Greedy[T]:
raise TypeError("Greedy[...] expects a type or a Converter instance.")

if converter in (str, type(None)) or origin is Greedy:
raise TypeError(f"Greedy[{converter.__name__}] is invalid.") # type: ignore
raise TypeError(f"Greedy[{converter.__name__}] is invalid.")

if origin is Union and type(None) in args:
raise TypeError(f"Greedy[{converter!r}] is invalid.")
Expand Down Expand Up @@ -1222,7 +1222,7 @@ async def _actual_conversion(
raise ConversionError(converter, exc) from exc

try:
return converter(argument)
return converter(argument) # type: ignore
except CommandError:
raise
except Exception as exc:
Expand Down
2 changes: 1 addition & 1 deletion disnake/ext/commands/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def __init__(
self.max_length = max_length
self.large = large

def copy(self) -> ParamInfo:
def copy(self) -> Self:
# n. b. this method needs to be manually updated when a new attribute is added.
cls = self.__class__
ins = cls.__new__(cls)
Expand Down
2 changes: 1 addition & 1 deletion docs/extensions/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def disable_mathjax(app: Sphinx, config: Config) -> None:
# inspired by https://github.com/readthedocs/sphinx-hoverxref/blob/003b84fee48262f1a969c8143e63c177bd98aa26/hoverxref/extension.py#L151

for listener in app.events.listeners.get("html-page-context", []):
module_name = inspect.getmodule(listener.handler).__name__ # type: ignore
module_name = inspect.getmodule(listener.handler).__name__
if module_name == "sphinx.ext.mathjax":
app.disconnect(listener.id)

Expand Down
2 changes: 2 additions & 0 deletions examples/interactions/modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

"""An example demonstrating two methods of sending modals and handling modal responses."""

# pyright: reportUnknownLambdaType=false

import asyncio
import os

Expand Down
2 changes: 1 addition & 1 deletion test_bot/cogs/modals.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def create_tag_low(self, inter: disnake.AppCmdInter[commands.Bot]) -> None

modal_inter: disnake.ModalInteraction = await self.bot.wait_for(
"modal_submit",
check=lambda i: i.custom_id == "create_tag2" and i.author.id == inter.author.id,
check=lambda i: i.custom_id == "create_tag2" and i.author.id == inter.author.id, # type: ignore # unknown parameter type
)

embed = disnake.Embed(title="Tag Creation")
Expand Down

0 comments on commit fbc4f8d

Please sign in to comment.