Question: I'm wondering if it's possible to make a class object iterable in Python (ie. a subclass of `type`, NOT an instance of a class).

I've tried the following code:

```
class Foo:
    @classmethod
    def __iter__(cls):
        yield 1

print(next(Foo.__iter__()))  # prints 1
print(next(iter(Foo)))  # TypeError: 'type' object is not iterable

```

Answer: 
Turns out it's possible with metaclasses.

```
class Foo(type):
    def __iter__(self):
        yield self.baz

class Bar(metaclass=Foo):
    baz = 1

print(type(Bar))  # prints "<class '__main__.Foo'>"
print(next(Bar.__iter__()))  # prints "1"
print(next(iter(Bar)))  # prints "1"

```

Thanks @DanielB for pointing me in the right direction.
This isn't possible, as it would imply that all `type` objects are iterable - as you stated, classes are of type `type`. The underlying reason for this is that the `__iter__` method is looked up on the type, not the value. E.g., in:

```
for i in Foo:
    print(i)

```

Python will look up `type(Foo).__iter__`, not `Foo.__iter__`.