import collections

Card = collections.namedtuple('Card', ['rank', 'suit'])

class FrenchDeck:
    ranks = [str(n) for n in range(2, 11)] + list('JQKA')
    suits = 'spades diamonds clubs hearts'.split()

    def __init__(self):
        self._cards = [Card(rank, suit) for suit in self.suits
                                        for rank in self.ranks]

    # def __len__(self):
        # return len(self._cards)

    # def __getitem__(self, position):
        # return self._cards[position]

    # def __setitem__(self, position, card):
        # self._cards[position] = card


# collections module
# collections.namedtuple
# list comprehensions
# special methods: len, getitem, setitem

# Collections contains several useful container datatypes.  
# - namedtuple()  
# - deque  
# - ChainMap  
# - Counter  
# - OrderedDict  
# - defaultdict  
# - userdict  
# - UserList  
# - UserString  
