From 3c1aaf86e9c5e5a9bfbbc63515f9d4f247c2e91e Mon Sep 17 00:00:00 2001 From: janga Date: Mon, 30 Jan 2017 22:25:18 +0530 Subject: [PATCH 1/2] Add type hints to alternator --- axelrod/strategies/alternator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/axelrod/strategies/alternator.py b/axelrod/strategies/alternator.py index ec52a0f4e..fadff2901 100644 --- a/axelrod/strategies/alternator.py +++ b/axelrod/strategies/alternator.py @@ -1,4 +1,5 @@ from axelrod import Actions, Player +import axelrod C, D = Actions.C, Actions.D @@ -17,7 +18,7 @@ class Alternator(Player): 'manipulates_state': False } - def strategy(self, opponent): + def strategy(self, opponent: axelrod.player.Player) -> axelrod.actions.Action: if len(self.history) == 0: return C if self.history[-1] == C: From 735f0e360061b00b309caabc85d975b0f1b61124 Mon Sep 17 00:00:00 2001 From: janga Date: Tue, 31 Jan 2017 13:13:10 +0530 Subject: [PATCH 2/2] Add type hints to alternator --- axelrod/strategies/alternator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/axelrod/strategies/alternator.py b/axelrod/strategies/alternator.py index fadff2901..5e066ce2c 100644 --- a/axelrod/strategies/alternator.py +++ b/axelrod/strategies/alternator.py @@ -1,5 +1,5 @@ from axelrod import Actions, Player -import axelrod +from axelrod.actions import Action C, D = Actions.C, Actions.D @@ -18,7 +18,7 @@ class Alternator(Player): 'manipulates_state': False } - def strategy(self, opponent: axelrod.player.Player) -> axelrod.actions.Action: + def strategy(self, opponent: Player) -> Action: if len(self.history) == 0: return C if self.history[-1] == C: