Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ellipsis type annotation #131

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading