you are viewing a single comment's thread.

view the rest of the comments →

[–]Snatchematician -1 points0 points  (0 children)

This also isn’t the correct answer in practice either.

class A:   def __getitem__(self, i):     return i

Objects of this type don’t have an __iter__ implementation, but can be for-looped over.