Has One Method, Not the Other

class Deck:
    def __init__(self, cards):
        self.cards = cards

    def __iter__(self):
        return iter(self.cards)

d = Deck([1, 2, 3])
next(d)

What happens when this runs?

A

It works because next() falls back to calling __iter__() automatically when __next__ is missing.

B

TypeError: 'Deck' object is not an iterator, because Deck defines __iter__ but has no __next__.

C

It prints 1, since Deck defines __iter__ and is therefore an iterator.

D

It raises StopIteration, since the deck's first call to next exhausts nothing yet.