Axelrod-Python / Axelrod

A research tool for the Iterated Prisoner's Dilemma
http://axelrod.readthedocs.org/
Other
728 stars 265 forks source link

LimitedHistory should override extend. #1451

Open gaffney2010 opened 4 weeks ago

gaffney2010 commented 4 weeks ago

LimitedHistory inherits extend from base class. However expected behavior is that LimitedHistory only keeps the last memory_depth history.

Should make this unittest on TestLimitedHistory pass.

    def test_extend(self):
        h1 = LimitedHistory(3, plays=[C, C, D], coplays=[C, C, C])
        self.assertEqual(list(h1), [C, C, D])
        h1.extend([C, C], [D, D])
        self.assertEqual(list(h1), [D, C, C])
LindyZh commented 1 week ago

Hi! Just wondering if anyone is currently working on this? I would love to contribute 😃

gaffney2010 commented 1 week ago

Hi! Just wondering if anyone is currently working on this? I would love to contribute 😃

It's all yours.