Skip to content

Commit

Permalink
Merge pull request #131 from ImogenBits/typings
Browse files Browse the repository at this point in the history
Add Ellipsis type annotation
  • Loading branch information
Benezivas authored Oct 5, 2023
2 parents 867a337 + 3f6e14a commit dc069a0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
13 changes: 7 additions & 6 deletions algobattle/battle.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from abc import abstractmethod
from inspect import isclass
from itertools import count
from types import EllipsisType
from typing import (
TYPE_CHECKING,
Any,
Expand Down Expand Up @@ -118,12 +119,12 @@ async def run(
self,
max_size: int,
*,
timeout_generator: float | None = ...,
space_generator: int | None = ...,
cpus_generator: int = ...,
timeout_solver: float | None = ...,
space_solver: int | None = ...,
cpus_solver: int = ...,
timeout_generator: float | None | EllipsisType = ...,
space_generator: int | None | EllipsisType = ...,
cpus_generator: int | EllipsisType = ...,
timeout_solver: float | None | EllipsisType = ...,
space_solver: int | None | EllipsisType = ...,
cpus_solver: int | EllipsisType = ...,
generator_battle_input: Encodable | None = None,
solver_battle_input: Encodable | None = None,
generator_battle_output: type[Encodable] | None = None,
Expand Down
25 changes: 13 additions & 12 deletions tests/test_battles.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for the Battle types."""
from enum import Enum
from itertools import chain, cycle
from types import EllipsisType
from typing import Iterable, TypeVar
from unittest import IsolatedAsyncioTestCase, main

Expand Down Expand Up @@ -51,12 +52,12 @@ async def run(
self,
max_size: int,
*,
timeout_generator: float | None = ...,
space_generator: int | None = ...,
cpus_generator: int = ...,
timeout_solver: float | None = ...,
space_solver: int | None = ...,
cpus_solver: int = ...,
timeout_generator: float | None | EllipsisType = ...,
space_generator: int | None | EllipsisType = ...,
cpus_generator: int | EllipsisType = ...,
timeout_solver: float | None | EllipsisType = ...,
space_solver: int | None | EllipsisType = ...,
cpus_solver: int | EllipsisType = ...,
generator_battle_input: Encodable | None = None,
solver_battle_input: Encodable | None = None,
generator_battle_output: type[Encodable] | None = None,
Expand Down Expand Up @@ -95,12 +96,12 @@ async def run(
self,
max_size: int,
*,
timeout_generator: float | None = ...,
space_generator: int | None = ...,
cpus_generator: int = ...,
timeout_solver: float | None = ...,
space_solver: int | None = ...,
cpus_solver: int = ...,
timeout_generator: float | None | EllipsisType = ...,
space_generator: int | None | EllipsisType = ...,
cpus_generator: int | EllipsisType = ...,
timeout_solver: float | None | EllipsisType = ...,
space_solver: int | None | EllipsisType = ...,
cpus_solver: int | EllipsisType = ...,
generator_battle_input: Encodable | None = None,
solver_battle_input: Encodable | None = None,
generator_battle_output: type[Encodable] | None = None,
Expand Down

0 comments on commit dc069a0

Please sign in to comment.