Skip to content

Commit

Permalink
Switch how we do type annotation of generation
Browse files Browse the repository at this point in the history
Still learning difference between ABC and typing
  • Loading branch information
WardLT committed Mar 7, 2024
1 parent 049eac0 commit 16af747
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions colmena/tests/test_task_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from typing import Tuple, List, Optional, Dict, Any
from collections.abc import Generator
from typing import Tuple, List, Optional, Dict, Any, Iterator
from pathlib import Path
from math import isnan

Expand Down Expand Up @@ -44,7 +43,7 @@ def echo(x: Any) -> Any:
return x


def generator(i: int) -> Generator[int, None, str]:
def generator(i: int) -> Iterator[int]:
"""Generator which iterates over a list then returns a string saying "done" """
yield from range(i)
return "done"
Expand Down

0 comments on commit 16af747

Please sign in to comment.