fork download
  1. class MyClass:
  2. def __reversed__(self):
  3. return "a string"
  4.  
  5. # for a in reversed(MyClass): # errors out
  6. for a in reversed(MyClass()): # doesn't
  7. pass
Success #stdin #stdout 0.03s 9984KB
stdin
Standard input is empty
stdout
Standard output is empty