Skip to content

Commit a8a8bd3

Browse files
committed
fix typing errors
1 parent 1c18131 commit a8a8bd3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

radicli/tests/test_cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Iterator, Optional, Literal, TypeVar, Generic, Type, Union
1+
from typing import List, Iterator, Optional, Literal, TypeVar, Generic, Type, Union, cast
22
from enum import Enum
33
from dataclasses import dataclass
44
import pytest
@@ -11,7 +11,7 @@
1111
from radicli import Radicli, StaticRadicli, Arg, get_arg, ArgparseArg, Command
1212
from radicli.util import CommandNotFoundError, CliParserError
1313
from radicli.util import ExistingPath, ExistingFilePath, ExistingDirPath
14-
from radicli.util import ExistingFilePathOrDash, DEFAULT_CONVERTERS
14+
from radicli.util import ExistingFilePathOrDash, DEFAULT_CONVERTERS, ConvertersType
1515
from radicli.util import stringify_type, get_list_converter, format_type
1616

1717

@@ -312,7 +312,7 @@ class CustomGeneric(Generic[_KindT]):
312312

313313
def test_cli_converters_generics():
314314
converters = {CustomGeneric: lambda value: f"generic: {value}"}
315-
cli = Radicli(converters=converters)
315+
cli = Radicli(converters=cast(ConvertersType, converters))
316316
ran = False
317317

318318
@cli.command("test", a=Arg("--a"))
@@ -960,7 +960,7 @@ def convert_generic(value: str) -> str:
960960
CustomGeneric[str]: str,
961961
}
962962

963-
def test(test: arg_type):
963+
def test(test: arg_type): # type: ignore
964964
...
965965

966966
cmd = Command.from_function(

radicli/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class StaticArg(TypedDict):
3131
option: Optional[str]
3232
short: Optional[str]
3333
orig_help: Optional[str]
34-
default: str
34+
default: Union[str, bool, None]
3535
help: Optional[str]
3636
action: Optional[str]
3737
choices: Optional[List[str]]
@@ -74,7 +74,7 @@ def __setitem__(self, key, value):
7474
def pop(self, key: Any, default=None):
7575
raise NotImplementedError(self.error)
7676

77-
def update(self, other, **kwargs):
77+
def update(self, *args, **kwargs):
7878
raise NotImplementedError(self.error)
7979

8080

0 commit comments

Comments
 (0)