Skip to content

Commit

Permalink
Bump mypy from 1.6.1 to 1.7.1 (#1766)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: davfsa <[email protected]>
  • Loading branch information
dependabot[bot] and davfsa authored Nov 29, 2023
1 parent 83cb1ab commit 8ee48fc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dev-requirements/mypy.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mypy==1.6.1
mypy==1.7.1
5 changes: 4 additions & 1 deletion hikari/impl/event_manager_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,10 @@ def dispatch(self, event: base_events.Event) -> asyncio.Future[typing.Any]:
del self._waiters[cls]
self._increment_waiter_group_count(cls, -1)

return asyncio.gather(*tasks) if tasks else aio.completed_future()
if tasks:
return asyncio.gather(*tasks)

return aio.completed_future()

def stream(
self,
Expand Down
2 changes: 1 addition & 1 deletion hikari/internal/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ async def all_of(*aws: typing.Awaitable[T_co], timeout: typing.Optional[float] =
typing.Sequence[T_co]
The results of each awaitable in the order they were invoked in.
"""
fs = tuple(map(asyncio.ensure_future, aws))
fs: typing.Tuple[asyncio.Future[T_co], ...] = tuple(map(asyncio.ensure_future, aws))
gatherer = asyncio.gather(*fs)

try:
Expand Down
5 changes: 1 addition & 4 deletions hikari/internal/attrs_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ def get_fields_definition(
init_results: typing.List[typing.Tuple[attrs.Attribute[typing.Any], str]] = []
non_init_results: typing.List[attrs.Attribute[typing.Any]] = []

# Mypy has a bug where it will always report
# "Argument 1 to "fields" has incompatible type "Type[AttrsInstance]"; expected an attrs class"
# even if the type is correct.
for field in attrs.fields(cls): # type: ignore[misc]
for field in attrs.fields(cls):
if field.init:
key_word = field.name[1:] if field.name.startswith("_") else field.name
init_results.append((field, key_word))
Expand Down

0 comments on commit 8ee48fc

Please sign in to comment.