Axelrod-Python/Axelrod

mypy update has broken type hints

drvinceknight opened this issue · 0 comments

Axelrod(master) ✗: python run_mypy.py
axelrod/fingerprint.py:308: error: Value of type variable "AnyStr" of "mkstemp" cannot be "Optional[Any]"
axelrod/fingerprint.py:327: error: Argument 1 to "remove" has incompatible type "Optional[Any]"; expected "Union[bytes, str]"
axelrod/fingerprint.py:446: error: Value of type variable "AnyStr" of "mkstemp" cannot be "Optional[str]"
axelrod/fingerprint.py:459: error: Argument 1 to "remove" has incompatible type "Optional[str]"; expected "Union[bytes, str]"
axelrod/moran.py:105: error: Incompatible types in assignment (expression has type "None", variable has type "str")
axelrod/moran.py:196: error: Invalid index type "Optional[int]" for "List[Any]"; expected type "int"
axelrod/moran.py:213: error: Argument 1 to "pop" of "list" has incompatible type "Optional[int]"; expected "int"
axelrod/moran.py:216: error: Unsupported operand types for >= ("int" and "Optional[int]")
axelrod/moran.py:358: error: Incompatible types in assignment (expression has type "None", variable has type "str")
axelrod/tournament.py:86: error: Incompatible types in assignment (expression has type "None", variable has type "str")
axelrod/tournament.py:87: error: Incompatible types in assignment (expression has type "None", variable has type "int")
axelrod/strategies/apavlov.py:32: error: Incompatible types in assignment (expression has type "None", variable has type "str")
axelrod/strategies/apavlov.py:96: error: Incompatible types in assignment (expression has type "None", variable has type "str")
axelrod/strategies/darwin.py:51: error: Incompatible types in assignment (expression has type "None", variable has type "Dict[Any, Any]")
axelrod/strategies/hunter.py:123: error: Incompatible types in assignment (expression has type "None", variable has type "Tuple[Any]")
axelrod/strategies/memoryone.py:196: error: Argument 1 to "round" has incompatible type "Optional[float]"; expected "float"

Working on this now (as it'll cause CI to break on incoming PRs).