Skip to content

Commit

Permalink
Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Feb 19, 2025
1 parent 29d2422 commit 4c89004
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tests/test_custom_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ def main(
)


def make_list_of_strings_with_minimum_length(args: list[str]) -> list[str]:
def make_list_of_strings_with_minimum_length(args: List[str]) -> List[str]:
if len(args) == 0:
raise ValueError("Expected at least one string")
return args


ListOfStringsWithMinimumLength = Annotated[
list[str],
List[str],
tyro.constructors.PrimitiveConstructorSpec(
nargs="*",
metavar="STR [STR ...]",
Expand All @@ -128,6 +128,7 @@ def test_min_length_custom_constructor() -> None:
def main(
field1: ListOfStringsWithMinimumLength, field2: int = 3
) -> ListOfStringsWithMinimumLength:
del field2
return field1

with pytest.raises(SystemExit):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ def main(
)


def make_list_of_strings_with_minimum_length(args: list[str]) -> list[str]:
def make_list_of_strings_with_minimum_length(args: List[str]) -> List[str]:
if len(args) == 0:
raise ValueError("Expected at least one string")
return args


ListOfStringsWithMinimumLength = Annotated[
list[str],
List[str],
tyro.constructors.PrimitiveConstructorSpec(
nargs="*",
metavar="STR [STR ...]",
Expand All @@ -127,6 +127,7 @@ def test_min_length_custom_constructor() -> None:
def main(
field1: ListOfStringsWithMinimumLength, field2: int = 3
) -> ListOfStringsWithMinimumLength:
del field2
return field1

with pytest.raises(SystemExit):
Expand Down

0 comments on commit 4c89004

Please # to comment.