+ 1
Why doesn't __iter__ = self.list.__iter__ work?
if I have a class like class CustomList(): def __init__(self, list): self.list = list How can I make my class iterate on self.list when needed? I tried doing __iter__ = self.list.__iter__ but it's not working
1 Answer
+ 3
I'd do it this way:
https://code.sololearn.com/c02g3cc3cC9p