Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

fix: Apply mypy 0.920 update #104

Merged
merged 5 commits into from
Dec 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/104.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix minor typing errors discovered by mypy 0.920 update
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ lint =
flake8>=4.0.1
flake8-commas>=2.1
typecheck =
mypy>=0.910
mypy>=0.920
types-python-dateutil
types-toml
types-setuptools
Expand Down
4 changes: 2 additions & 2 deletions src/ai/backend/common/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from importlib import import_module
import re
from types import FunctionType
from typing import Any, Optional, Union, Type, cast
from typing import Any, Optional, Union, Type

import click

Expand Down Expand Up @@ -58,7 +58,7 @@ class EnumChoice(click.Choice):
enum: Type[Enum]

def __init__(self, enum: Type[Enum]):
super().__init__([*cast(Enum, enum)._member_map_.keys()])
super().__init__([*enum._member_map_.keys()])
self.enum = enum

def convert(self, value: Any, param, ctx):
Expand Down
2 changes: 1 addition & 1 deletion src/ai/backend/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def new(cls: Type[T_aobj], *args, **kwargs) -> T_aobj:
This is a copy of ``__new__()`` to workaround it.
'''
instance = super().__new__(cls)
instance.__init__(*args, **kwargs)
cls.__init__(instance, *args, **kwargs)
await instance.__ainit__()
return instance

Expand Down