From 7847ac43442aa3ab5d5a5814e146a9ca677dc44a Mon Sep 17 00:00:00 2001 From: Andrea Micheli Date: Thu, 14 Mar 2024 13:56:13 +0100 Subject: [PATCH] Fixed issue with the new version of mypy: forced generics variable to be either Fraction, int or float --- unified_planning/model/delta_stn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unified_planning/model/delta_stn.py b/unified_planning/model/delta_stn.py index 2914bcd34..a67ec5c45 100644 --- a/unified_planning/model/delta_stn.py +++ b/unified_planning/model/delta_stn.py @@ -16,11 +16,11 @@ from collections import deque from dataclasses import dataclass -from numbers import Real +from fractions import Fraction from typing import Deque, Dict, List, Optional, Any, Generic, Set, Tuple, TypeVar, cast -T = TypeVar("T", bound=Real) +T = TypeVar("T", Fraction, float, int) @dataclass @@ -60,7 +60,7 @@ def __init__( constraints: Optional[Dict[Any, Optional[DeltaNeighbors[T]]]] = None, distances: Optional[Dict[Any, T]] = None, is_sat: bool = True, - epsilon: T = cast(T, 0), + epsilon=cast(T, 0), ): self._constraints: Dict[Any, Optional[DeltaNeighbors[T]]] = ( constraints if constraints is not None else {}