Skip to content

Commit a66dcc5

Browse files
committed
Remove static methods to make type checker happy.
1 parent 38989f5 commit a66dcc5

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

axelrod/strategies/averagecopier.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ class AverageCopier(Player):
2222
'manipulates_state': False
2323
}
2424

25-
@staticmethod
26-
def strategy(opponent: Player) -> Action:
25+
def strategy(self, opponent: Player) -> Action:
2726
if len(opponent.history) == 0:
2827
# Randomly picks a strategy (not affected by history).
2928
return random_choice(0.5)
@@ -45,8 +44,7 @@ class NiceAverageCopier(Player):
4544
'manipulates_state': False
4645
}
4746

48-
@staticmethod
49-
def strategy(opponent: Player) -> Action:
47+
def strategy(self, opponent: Player) -> Action:
5048
if len(opponent.history) == 0:
5149
return C
5250
p = opponent.cooperations // len(opponent.history)

axelrod/strategies/forgiver.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ class Forgiver(Player):
2222
'manipulates_state': False
2323
}
2424

25-
@staticmethod
26-
def strategy(opponent: Player) -> Action:
25+
def strategy(self, opponent: Player) -> Action:
2726
"""
2827
Begins by playing C, then plays D if the opponent has defected more than 10 percent of the time
2928
"""
@@ -50,8 +49,7 @@ class ForgivingTitForTat(Player):
5049
'manipulates_state': False
5150
}
5251

53-
@staticmethod
54-
def strategy(opponent: Player) -> Action:
52+
def strategy(self, opponent: Player) -> Action:
5553
"""
5654
Begins by playing C, then plays D if,
5755
the opponent has defected more than 10 percent of the time,

0 commit comments

Comments
 (0)