fix: add cast to resolve mypy list covariance errors in _build_attrs_patch_block
Co-authored-by: Kevin Turcios <undefined@users.noreply.github.com>
This commit is contained in:
parent
aae0171b1c
commit
01d8fafabb
1 changed files with 13 additions and 10 deletions
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
import ast
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, cast
|
||||
|
||||
from codeflash.code_utils.code_utils import get_run_tmp_file
|
||||
from codeflash.code_utils.formatter import sort_imports
|
||||
|
|
@ -271,16 +271,19 @@ class InitDecorator(ast.NodeTransformer):
|
|||
kwarg=self._kwargs_arg_node,
|
||||
defaults=[],
|
||||
),
|
||||
body=[
|
||||
ast.Return(
|
||||
value=ast.Call(
|
||||
func=ast.Name(id=orig_name, ctx=self._load_ctx),
|
||||
args=[self._self_name_load, self._starred_args],
|
||||
keywords=[self._kwargs_keyword],
|
||||
body=cast(
|
||||
list[ast.stmt],
|
||||
[
|
||||
ast.Return(
|
||||
value=ast.Call(
|
||||
func=ast.Name(id=orig_name, ctx=self._load_ctx),
|
||||
args=[self._self_name_load, self._starred_args],
|
||||
keywords=[self._kwargs_keyword],
|
||||
)
|
||||
)
|
||||
)
|
||||
],
|
||||
decorator_list=[],
|
||||
],
|
||||
),
|
||||
decorator_list=cast(list[ast.expr], []),
|
||||
returns=None,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue