beginning implementations of CardCollection and some of its subclasses

This commit is contained in:
2020-03-17 22:43:03 -04:00
parent 2e676e4708
commit c1120bcd93
7 changed files with 57 additions and 1 deletions
@@ -0,0 +1,10 @@
from collections import deque
from .. import Card
class CardCollection(deque):
def __init__(self, iterable, maxlen=None):
if not len(iterable) == 0 or all([isinstance(Card, item) for item in iterable]):
raise TypeError("CardCollections must only contain Cards")
else:
super().__init__(iterable, maxlen)